rbs 0.11.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +9 -9
  3. data/CHANGELOG.md +24 -0
  4. data/Rakefile +16 -6
  5. data/Steepfile +28 -0
  6. data/bin/steep +4 -0
  7. data/bin/test_runner.rb +7 -5
  8. data/lib/rbs/ast/comment.rb +7 -1
  9. data/lib/rbs/ast/declarations.rb +15 -9
  10. data/lib/rbs/buffer.rb +1 -1
  11. data/lib/rbs/cli.rb +12 -4
  12. data/lib/rbs/constant.rb +1 -1
  13. data/lib/rbs/constant_table.rb +9 -8
  14. data/lib/rbs/definition.rb +22 -13
  15. data/lib/rbs/definition_builder.rb +79 -55
  16. data/lib/rbs/environment.rb +28 -10
  17. data/lib/rbs/environment_loader.rb +12 -12
  18. data/lib/rbs/location.rb +1 -5
  19. data/lib/rbs/method_type.rb +5 -5
  20. data/lib/rbs/namespace.rb +14 -3
  21. data/lib/rbs/parser.y +0 -8
  22. data/lib/rbs/prototype/rb.rb +3 -4
  23. data/lib/rbs/prototype/rbi.rb +1 -2
  24. data/lib/rbs/substitution.rb +4 -3
  25. data/lib/rbs/type_name.rb +18 -1
  26. data/lib/rbs/type_name_resolver.rb +10 -3
  27. data/lib/rbs/types.rb +27 -21
  28. data/lib/rbs/variance_calculator.rb +9 -6
  29. data/lib/rbs/version.rb +1 -1
  30. data/lib/rbs/writer.rb +25 -15
  31. data/sig/annotation.rbs +26 -0
  32. data/sig/buffer.rbs +28 -0
  33. data/sig/builtin_names.rbs +41 -0
  34. data/sig/comment.rbs +26 -0
  35. data/sig/constant.rbs +21 -0
  36. data/sig/constant_table.rbs +30 -0
  37. data/sig/declarations.rbs +202 -0
  38. data/sig/definition.rbs +129 -0
  39. data/sig/definition_builder.rbs +94 -0
  40. data/sig/environment.rbs +94 -0
  41. data/sig/environment_loader.rbs +58 -0
  42. data/sig/location.rbs +52 -0
  43. data/sig/members.rbs +160 -0
  44. data/sig/method_types.rbs +40 -0
  45. data/sig/namespace.rbs +124 -0
  46. data/sig/polyfill.rbs +3 -0
  47. data/sig/rbs.rbs +3 -0
  48. data/sig/substitution.rbs +39 -0
  49. data/sig/type_name_resolver.rbs +24 -0
  50. data/sig/typename.rbs +70 -0
  51. data/sig/types.rbs +361 -0
  52. data/sig/util.rbs +13 -0
  53. data/sig/variance_calculator.rbs +35 -0
  54. data/sig/version.rbs +3 -0
  55. data/sig/writer.rbs +40 -0
  56. data/stdlib/bigdecimal/big_decimal.rbs +887 -0
  57. data/stdlib/bigdecimal/math/big_math.rbs +142 -0
  58. data/stdlib/builtin/builtin.rbs +0 -3
  59. data/stdlib/builtin/kernel.rbs +2 -0
  60. data/stdlib/builtin/math.rbs +26 -26
  61. data/stdlib/builtin/struct.rbs +9 -10
  62. data/stdlib/forwardable/forwardable.rbs +204 -0
  63. data/stdlib/pathname/pathname.rbs +2 -0
  64. data/stdlib/pty/pty.rbs +5 -29
  65. data/stdlib/set/set.rbs +1 -1
  66. data/stdlib/uri/file.rbs +167 -0
  67. data/stdlib/uri/generic.rbs +875 -0
  68. data/stdlib/uri/http.rbs +158 -0
  69. data/stdlib/uri/https.rbs +108 -0
  70. data/stdlib/uri/ldap.rbs +224 -0
  71. data/stdlib/uri/ldaps.rbs +108 -0
  72. data/steep/Gemfile +3 -0
  73. data/steep/Gemfile.lock +51 -0
  74. metadata +43 -5
@@ -0,0 +1,129 @@
1
+ module RBS
2
+ class Definition
3
+ type accessibility = :public | :private
4
+
5
+ class Variable
6
+ attr_reader parent_variable: Variable?
7
+ attr_reader type: Types::t
8
+ attr_reader declared_in: TypeName
9
+
10
+ def initialize: (parent_variable: Variable?, type: Types::t, declared_in: TypeName) -> void
11
+
12
+ def sub: (Substitution) -> Variable
13
+ end
14
+
15
+ class Method
16
+ type method_member = AST::Members::MethodDefinition | AST::Members::AttrReader | AST::Members::AttrAccessor | AST::Members::AttrWriter
17
+
18
+ class TypeDef
19
+ attr_reader type: MethodType
20
+ attr_reader member: method_member
21
+ attr_reader defined_in: TypeName?
22
+ attr_reader implemented_in: TypeName?
23
+
24
+ def initialize: (type: MethodType, member: method_member, defined_in: TypeName?, implemented_in: TypeName?) -> void
25
+
26
+ def comment: () -> AST::Comment?
27
+
28
+ def annotations: () -> Array[AST::Annotation]
29
+
30
+ def update: (?type: MethodType, ?member: method_member, ?defined_in: TypeName?, ?implemented_in: TypeName?) -> TypeDef
31
+
32
+ def overload?: () -> bool
33
+ end
34
+
35
+ attr_reader super_method: Method?
36
+ attr_reader defs: Array[TypeDef]
37
+ attr_reader accessibility: accessibility
38
+ attr_reader extra_annotations: Array[AST::Annotation]
39
+ attr_reader defined_in: TypeName?
40
+ attr_reader implemented_in: TypeName?
41
+ attr_reader method_types: Array[MethodType]
42
+ attr_reader comments: Array[AST::Comment]
43
+ attr_reader annotations: Array[AST::Annotation]
44
+ attr_reader members: Array[method_member]
45
+
46
+ def initialize: (super_method: Method?, defs: Array[TypeDef], accessibility: accessibility, ?annotations: Array[AST::Annotation]) -> void
47
+
48
+ def public?: () -> bool
49
+
50
+ def private?: () -> bool
51
+
52
+ def sub: (Substitution) -> Method
53
+
54
+ def map_type: () { (Types::t) -> Types::t } -> Method
55
+
56
+ def map_method_type: () { (MethodType) -> MethodType } -> Method
57
+ end
58
+
59
+ module Ancestor
60
+ type t = Instance | Singleton
61
+
62
+ class Instance
63
+ attr_reader name: TypeName
64
+ attr_reader args: Array[Types::t]
65
+
66
+ def initialize: (name: TypeName, args: Array[Types::t]) -> void
67
+ end
68
+
69
+ class Singleton
70
+ attr_reader name: TypeName
71
+
72
+ def initialize: (name: TypeName) -> void
73
+ end
74
+ end
75
+
76
+ class InstanceAncestors
77
+ attr_reader type_name: TypeName
78
+ attr_reader params: Array[Symbol]
79
+ attr_reader ancestors: Array[Ancestor::t]
80
+
81
+ def initialize: (type_name: TypeName, params: Array[Symbol], ancestors: Array[Ancestor::t]) -> void
82
+
83
+ def apply: (Array[Types::t], location: Location?) -> Array[Ancestor::t]
84
+ end
85
+
86
+ class SingletonAncestors
87
+ attr_reader type_name: TypeName
88
+ attr_reader ancestors: Array[Ancestor::t]
89
+
90
+ def initialize: (type_name: TypeName, ancestors: Array[Ancestor::t]) -> void
91
+ end
92
+
93
+ type self_type = Types::ClassSingleton | Types::ClassInstance | Types::Interface
94
+ type definition_entry = Environment::ModuleEntry | Environment::ClassEntry | Environment::SingleEntry[TypeName, AST::Declarations::Interface]
95
+
96
+ attr_reader type_name: TypeName
97
+ attr_reader entry: definition_entry
98
+ attr_reader ancestors: InstanceAncestors | SingletonAncestors | nil
99
+ attr_reader self_type: self_type
100
+ attr_reader methods: Hash[Symbol, Method]
101
+ attr_reader instance_variables: Hash[Symbol, Variable]
102
+ attr_reader class_variables: Hash[Symbol, Variable]
103
+
104
+ def initialize: (type_name: TypeName, entry: definition_entry, self_type: self_type, ancestors: InstanceAncestors | SingletonAncestors | nil) -> void
105
+
106
+ def class?: () -> bool
107
+
108
+ def module?: () -> bool
109
+
110
+ def interface?: () -> bool
111
+
112
+ def class_type?: () -> bool
113
+
114
+ def instance_type?: () -> bool
115
+
116
+ def interface_type?: () -> bool
117
+
118
+ def type_params: () -> Array[Symbol]
119
+
120
+ def type_params_decl: () -> AST::Declarations::ModuleTypeParams
121
+
122
+ def sub: (Substitution) -> Definition
123
+
124
+ def map_method_type: () { (MethodType) -> MethodType } -> Definition
125
+
126
+ def each_type: () { (Types::t) -> void } -> void
127
+ | () -> Enumerator[Types::t, void]
128
+ end
129
+ end
@@ -0,0 +1,94 @@
1
+ module RBS
2
+ class DefinitionBuilder
3
+ class OneAncestors
4
+ attr_reader type_name: TypeName
5
+ attr_reader params: Array[Symbol]?
6
+ attr_reader super_class: Definition::Ancestor::t?
7
+ attr_reader self_types: Array[Definition::Ancestor::Instance]?
8
+ attr_reader included_modules: Array[Definition::Ancestor::Instance]?
9
+ attr_reader prepended_modules: Array[Definition::Ancestor::Instance]?
10
+ attr_reader extended_modules: Array[Definition::Ancestor::Instance]?
11
+
12
+ def initialize: (type_name: TypeName,
13
+ params: Array[Symbol]?,
14
+ super_class: Definition::Ancestor::t?,
15
+ self_types: Array[Definition::Ancestor::Instance]?,
16
+ included_modules: Array[Definition::Ancestor::Instance]?,
17
+ prepended_modules: Array[Definition::Ancestor::Instance]?,
18
+ extended_modules: Array[Definition::Ancestor::Instance]?) -> void
19
+
20
+ def each_ancestor: { (Definition::Ancestor::t) -> void } -> void
21
+ | -> Enumerator[Definition::Ancestor::t, void]
22
+
23
+ def self.class_instance: (type_name: TypeName, params: Array[Symbol], super_class: Definition::Ancestor::t?) -> instance
24
+
25
+ def self.singleton: (type_name: TypeName, super_class: Definition::Ancestor::t?) -> instance
26
+
27
+ def self.module_instance: (type_name: TypeName, params: Array[Symbol]) -> instance
28
+ end
29
+
30
+ attr_reader env: Environment
31
+ attr_reader type_name_resolver: TypeNameResolver
32
+
33
+ attr_reader instance_cache: Hash[TypeName, Definition | false | nil]
34
+ attr_reader singleton_cache: Hash[TypeName, Definition | false | nil]
35
+ attr_reader interface_cache: Hash[TypeName, Definition | false | nil]
36
+
37
+ attr_reader one_instance_cache: Hash[TypeName, Definition]
38
+ attr_reader one_singleton_cache: Hash[TypeName, Definition]
39
+
40
+ attr_reader instance_ancestors_cache: Hash[TypeName, Definition::InstanceAncestors]
41
+ attr_reader singleton_ancestor_cache: Hash[TypeName, Definition::SingletonAncestors]
42
+
43
+ attr_reader one_instance_ancestors_cache: Hash[TypeName, OneAncestors]
44
+ attr_reader one_singleton_ancestors_cache: Hash[TypeName, OneAncestors]
45
+
46
+ def initialize: (env: Environment) -> void
47
+
48
+ def validate_super_class!: (TypeName, Environment::ClassEntry) -> void
49
+
50
+ def one_instance_ancestors: (TypeName) -> OneAncestors
51
+
52
+ def one_singleton_ancestors: (TypeName) -> OneAncestors
53
+
54
+ def instance_ancestors: (TypeName, ?building_ancestors: Array[Definition::Ancestor::t]) -> Definition::InstanceAncestors
55
+
56
+ def singleton_ancestors: (TypeName, ?building_ancestors: Array[Definition::Ancestor::t]) -> Definition::SingletonAncestors
57
+
58
+ def mixin_ancestors: (Environment::ClassEntry | Environment::ModuleEntry, included_modules: Array[Definition::Ancestor::Instance]?, prepended_modules: Array[Definition::Ancestor::Instance]?, extended_modules: Array[Definition::Ancestor::Instance]?) -> void
59
+
60
+ def each_member_with_accessibility: (Array[AST::Members::t | AST::Declarations::t], ?accessibility: Definition::accessibility) { (AST::Members::t | AST::Declarations::t, Definition::accessibility) -> void } -> void
61
+
62
+ def ensure_namespace!: (Namespace, location: Location?) -> void
63
+
64
+ def build_instance: (TypeName) -> Definition
65
+
66
+ def build_interface: (TypeName) -> Definition
67
+
68
+ def build_one_instance: (TypeName) -> Definition
69
+
70
+ def build_one_singleton: (TypeName) -> Definition
71
+
72
+ def merge_definitions: (TypeName,
73
+ Array[[Definition::Ancestor::t, Definition]],
74
+ entry: Environment::ModuleEntry | Environment::ClassEntry,
75
+ self_type: Definition::self_type,
76
+ ancestors: Array[Definition::Ancestor::t]) -> Definition
77
+
78
+ type method_kind = :instance | :singleton
79
+ def merge_method: (TypeName, Hash[Symbol, Definition::Method], Symbol, Definition::Method, Substitution, kind: method_kind) -> void
80
+
81
+ def merge_variable: (Hash[Symbol, Definition::Variable], Symbol, Definition::Variable) -> void
82
+
83
+ def try_cache: (TypeName, cache: Hash[TypeName, Definition | false | nil]) { () -> Definition } -> Definition
84
+
85
+ type member_detail = [Definition::accessibility, Definition::Method?, AST::Members::MethodDefinition?, Array[AST::Members::MethodDefinition]]
86
+ def method_definition_members: (TypeName, Environment::ClassEntry | Environment::ModuleEntry, kind: :singleton | :instance) -> Hash[Symbol, member_detail]
87
+
88
+ def validate_params_with: (AST::Declarations::ModuleTypeParams, result: VarianceCalculator::Result) { (AST::Declarations::ModuleTypeParams::TypeParam) -> void } -> void
89
+
90
+ def validate_parameter_variance: (decl: AST::Declarations::Class | AST::Declarations::Module | AST::Declarations::Interface, methods: Hash[Symbol, Definition::Method]) -> void
91
+
92
+ def expand_alias: (TypeName) -> Types::t
93
+ end
94
+ end
@@ -0,0 +1,94 @@
1
+ module RBS
2
+ class Environment
3
+ type module_decl = AST::Declarations::Class | AST::Declarations::Module
4
+
5
+ interface _WithContext
6
+ def outer: () -> Array[module_decl]
7
+
8
+ def decl: () -> module_decl
9
+ end
10
+
11
+ module ContextUtil : _WithContext
12
+ def context: () -> Array[Namespace]
13
+ end
14
+
15
+ class MultiEntry
16
+ class D[M]
17
+ attr_reader decl: M
18
+ attr_reader outer: Array[module_decl]
19
+
20
+ def initialize: (decl: module_decl, outer: Array[module_decl]) -> void
21
+
22
+ include ContextUtil
23
+ end
24
+
25
+ attr_reader name: TypeName
26
+ attr_reader decls: Array[D[module_decl]]
27
+
28
+ def initialize: (name: TypeName) -> void
29
+
30
+ def insert: (decl: module_decl, outer: Array[module_decl]) -> void
31
+
32
+ def validate_type_params: () -> void
33
+
34
+ def type_params: () -> AST::Declarations::ModuleTypeParams
35
+
36
+ def primary: () -> D[module_decl]
37
+ end
38
+
39
+ class ModuleEntry < MultiEntry
40
+ attr_reader decls: Array[MultiEntry::D[AST::Declarations::Module]]
41
+ attr_reader primary: MultiEntry::D[AST::Declarations::Module]
42
+
43
+ def self_types: () -> Array[AST::Declarations::Module::Self]
44
+ end
45
+
46
+ class ClassEntry < MultiEntry
47
+ attr_reader decls: Array[MultiEntry::D[AST::Declarations::Class]]
48
+ attr_reader primary: MultiEntry::D[AST::Declarations::Class]
49
+ end
50
+
51
+ class SingleEntry[N, D]
52
+ include ContextUtil
53
+
54
+ attr_reader name: N
55
+ attr_reader decl: D
56
+ attr_reader outer: Array[module_decl]
57
+
58
+ def initialize: (name: N, decl: D, outer: Array[module_decl]) -> void
59
+ end
60
+
61
+ attr_reader buffers: Array[Buffer]
62
+ attr_reader declarations: Array[AST::Declarations::t]
63
+
64
+ attr_reader class_decls: Hash[TypeName, ModuleEntry | ClassEntry]
65
+ attr_reader interface_decls: Hash[TypeName, SingleEntry[TypeName, AST::Declarations::Interface]]
66
+ attr_reader alias_decls: Hash[TypeName, SingleEntry[TypeName, AST::Declarations::Alias]]
67
+ attr_reader constant_decls: Hash[TypeName, SingleEntry[TypeName, AST::Declarations::Constant]]
68
+ attr_reader global_decls: Hash[Symbol, SingleEntry[Symbol, AST::Declarations::Global]]
69
+
70
+ def initialize: () -> void
71
+
72
+ def initialize_copy: (Environment) -> void
73
+
74
+ def self.from_loader: (EnvironmentLoader) -> Environment
75
+
76
+ def cache_name: [Key, D] (Hash[Key, SingleEntry[Key, D]] cache, name: Key, decl: D, outer: Array[module_decl]) -> SingleEntry[Key, D]
77
+
78
+ def insert_decl: (AST::Declarations::t, outer: Array[module_decl], namespace: Namespace) -> void
79
+
80
+ def <<: (AST::Declarations::t decl) -> self
81
+
82
+ def resolve_type_names: () -> Environment
83
+
84
+ def resolve_declaration: (TypeNameResolver resolver, AST::Declarations::t decl, outer: Array[module_decl], prefix: Namespace) -> AST::Declarations::t
85
+
86
+ def resolve_member: (TypeNameResolver, AST::Members::t, context: Array[Namespace]) -> AST::Members::t
87
+
88
+ def absolute_type: (TypeNameResolver, Types::t, context: Array[Namespace]) -> Types::t
89
+
90
+ def absolute_type_name: (TypeNameResolver, TypeName, context: Array[Namespace]) -> TypeName
91
+
92
+ def inspect: () -> String
93
+ end
94
+ end
@@ -0,0 +1,58 @@
1
+ module RBS
2
+ class EnvironmentLoader
3
+ class UnknownLibraryNameError < StandardError
4
+ attr_reader name: String
5
+
6
+ def initialize: (name: String) -> void
7
+ end
8
+
9
+ class LibraryPath
10
+ attr_reader name: String
11
+ attr_reader path: Pathname
12
+
13
+ def initialize: (name: String, path: Pathname) -> void
14
+ end
15
+
16
+ class GemPath
17
+ attr_reader name: String
18
+ attr_reader version: String?
19
+ attr_reader path: Pathname
20
+
21
+ def initialize: (name: String, version: String?, path: Pathname) -> void
22
+ end
23
+
24
+ STDLIB_ROOT: Pathname
25
+
26
+ type path = Pathname | LibraryPath | GemPath
27
+
28
+ attr_reader paths: Array[path]
29
+ attr_reader stdlib_root: Pathname
30
+ attr_reader gem_vendor_path: Pathname?
31
+
32
+ def self.gem_sig_path: (String, String?) -> Pathname?
33
+
34
+ def initialize: (?stdlib_root: Pathname, ?gem_vendor_path: Pathname?) -> void
35
+
36
+ def add: (path: Pathname?) -> void
37
+ | (library: String?) -> void
38
+
39
+ def self.parse_library: (String) -> [String, String?]
40
+
41
+ def stdlib?: (String) -> Pathname?
42
+
43
+ def gem?: (String, String?) -> Pathname?
44
+
45
+ def each_signature: (Pathname, ?immediate: bool) { (Pathname) -> void } -> void
46
+ | (Pathname, ?immediate: bool) -> Enumerator[Pathname, void]
47
+
48
+ def each_library_path: { (path, Pathname) -> void } -> void
49
+
50
+ def no_builtin!: (?bool) -> self
51
+
52
+ def no_builtin?: () -> bool
53
+
54
+ def each_decl: () { (AST::Declarations::t, Buffer, Pathname, path | :stdlib) -> void } -> void
55
+
56
+ def load: (env: Environment) -> Array[[AST::Declarations::t, Pathname, path | :stdlib]]
57
+ end
58
+ end
@@ -0,0 +1,52 @@
1
+ module RBS
2
+ # Location is the range on buffer, `start_pos..end_pos`.
3
+ # The index is based on characters.
4
+ class Location
5
+ # The buffer this location points on.
6
+ attr_reader buffer: Buffer
7
+
8
+ # The index of character the range starts from.
9
+ attr_reader start_pos: Integer
10
+
11
+ # The index of character the range ends at.
12
+ attr_reader end_pos: Integer
13
+
14
+ def initialize: (buffer: Buffer, start_pos: Integer, end_pos: Integer) -> void
15
+
16
+ def inspect: () -> ::String
17
+
18
+ def name: () -> untyped
19
+
20
+ def start_line: () -> Integer
21
+
22
+ def start_column: () -> Integer
23
+
24
+ def end_line: () -> Integer
25
+
26
+ def end_column: () -> Integer
27
+
28
+ def start_loc: () -> Buffer::loc
29
+
30
+ def end_loc: () -> Buffer::loc
31
+
32
+ def source: () -> String
33
+
34
+ def to_s: () -> String
35
+
36
+ def self.to_string: (Location? location, ?default: ::String default) -> String
37
+
38
+ def ==: (untyped other) -> bool
39
+
40
+ def +: (Location other) -> Location
41
+
42
+ def pred?: (Location loc) -> bool
43
+
44
+ def to_json: (*untyped args) -> untyped
45
+
46
+ # `<<` locations given as argument.
47
+ def concat: (*Location?) -> Location
48
+
49
+ # Append given location destructively.
50
+ def <<: (Location?) -> Location
51
+ end
52
+ end
@@ -0,0 +1,160 @@
1
+ module RBS
2
+ module AST
3
+ module Members
4
+ type t = MethodDefinition
5
+ | InstanceVariable | ClassInstanceVariable | ClassVariable
6
+ | Include | Extend | Prepend
7
+ | AttrReader | AttrWriter | AttrAccessor
8
+ | Public | Private
9
+ | Alias
10
+
11
+ # Base class for members.
12
+ class Base
13
+ end
14
+
15
+ class MethodDefinition < Base
16
+ type kind = :instance | :singleton | :singleton_instance
17
+
18
+ attr_reader name: Symbol
19
+ attr_reader kind: kind
20
+ attr_reader types: Array[MethodType]
21
+ attr_reader annotations: Array[Annotation]
22
+ attr_reader location: Location?
23
+ attr_reader comment: Comment?
24
+ attr_reader overload: bool
25
+
26
+ def initialize: (name: Symbol, kind: kind, types: Array[MethodType], annotations: Array[Annotation], location: Location?, comment: Comment?, overload: bool) -> void
27
+
28
+ include _HashEqual
29
+ include _ToJson
30
+
31
+ def instance?: () -> bool
32
+
33
+ def singleton?: () -> bool
34
+
35
+ def overload?: () -> bool
36
+
37
+ def update: (?name: Symbol, ?kind: kind, ?types: Array[MethodType], ?annotations: Array[Annotation], ?location: Location?, ?comment: Comment?, ?overload: bool) -> MethodDefinition
38
+ end
39
+
40
+ module Var
41
+ attr_reader name: Symbol
42
+ attr_reader type: Types::t
43
+ attr_reader location: Location?
44
+ attr_reader comment: Comment?
45
+
46
+ def initialize: (name: Symbol, type: Types::t, location: Location?, comment: Comment?) -> void
47
+
48
+ include _HashEqual
49
+ end
50
+
51
+ class InstanceVariable < Base
52
+ include Var
53
+ include _ToJson
54
+ end
55
+
56
+ class ClassInstanceVariable < Base
57
+ include Var
58
+ include _ToJson
59
+ end
60
+
61
+ class ClassVariable < Base
62
+ include Var
63
+ include _ToJson
64
+ end
65
+
66
+ module Mixin
67
+ attr_reader name: TypeName
68
+ attr_reader args: Array[Types::t]
69
+ attr_reader annotations: Array[Annotation]
70
+ attr_reader location: Location?
71
+ attr_reader comment: Comment?
72
+
73
+ def initialize: (name: TypeName, args: Array[Types::t], annotations: Array[Annotation], location: Location?, comment: Comment?) -> void
74
+
75
+ include _HashEqual
76
+ end
77
+
78
+ class Include < Base
79
+ include Mixin
80
+ include _ToJson
81
+ end
82
+
83
+ class Extend < Base
84
+ include Mixin
85
+ include _ToJson
86
+ end
87
+
88
+ class Prepend < Base
89
+ include Mixin
90
+ include _ToJson
91
+ end
92
+
93
+ module Attribute
94
+ attr_reader name: Symbol
95
+ attr_reader type: Types::t
96
+ attr_reader ivar_name: Symbol | false | nil
97
+ attr_reader annotations: Array[Annotation]
98
+ attr_reader location: Location?
99
+ attr_reader comment: Comment?
100
+
101
+ def initialize: (name: Symbol, type: Types::t, ivar_name: Symbol | false | nil, annotations: Array[Annotation], location: Location?, comment: Comment?) -> void
102
+
103
+ include _HashEqual
104
+ end
105
+
106
+ class AttrReader < Base
107
+ include Attribute
108
+ include _ToJson
109
+ end
110
+
111
+ class AttrAccessor < Base
112
+ include Attribute
113
+ include _ToJson
114
+ end
115
+
116
+ class AttrWriter < Base
117
+ include Attribute
118
+ include _ToJson
119
+ end
120
+
121
+ module LocationOnly
122
+ attr_reader location: Location?
123
+
124
+ def initialize: (location: Location?) -> void
125
+
126
+ include _HashEqual
127
+ end
128
+
129
+ class Public < Base
130
+ include LocationOnly
131
+ include _ToJson
132
+ end
133
+
134
+ class Private < Base
135
+ include LocationOnly
136
+ include _ToJson
137
+ end
138
+
139
+ class Alias < Base
140
+ type kind = :instance | :singleton
141
+
142
+ attr_reader new_name: Symbol
143
+ attr_reader old_name: Symbol
144
+ attr_reader kind: kind
145
+ attr_reader annotations: Array[Annotation]
146
+ attr_reader location: Location?
147
+ attr_reader comment: Comment?
148
+
149
+ def initialize: (new_name: Symbol, old_name: Symbol, kind: kind, annotations: Array[Annotation], location: Location?, comment: Comment?) -> void
150
+
151
+ include _HashEqual
152
+ include _ToJson
153
+
154
+ def instance?: () -> bool
155
+
156
+ def singleton?: () -> bool
157
+ end
158
+ end
159
+ end
160
+ end