steep 1.3.0.pre.2 → 1.4.0.dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby-windows.yml +1 -0
  3. data/.github/workflows/ruby.yml +1 -5
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +17 -14
  7. data/Gemfile.steep +2 -2
  8. data/Gemfile.steep.lock +5 -5
  9. data/bin/rbs +21 -0
  10. data/bin/setup +1 -1
  11. data/lib/steep/ast/types/class.rb +9 -3
  12. data/lib/steep/ast/types/factory.rb +9 -2
  13. data/lib/steep/ast/types/instance.rb +8 -3
  14. data/lib/steep/ast/types/intersection.rb +6 -2
  15. data/lib/steep/ast/types/literal.rb +1 -1
  16. data/lib/steep/ast/types/logic.rb +1 -3
  17. data/lib/steep/ast/types/name.rb +11 -5
  18. data/lib/steep/ast/types/proc.rb +5 -5
  19. data/lib/steep/ast/types/record.rb +5 -1
  20. data/lib/steep/ast/types/self.rb +8 -2
  21. data/lib/steep/ast/types/tuple.rb +7 -5
  22. data/lib/steep/ast/types/union.rb +10 -4
  23. data/lib/steep/ast/types/var.rb +1 -1
  24. data/lib/steep/index/rbs_index.rb +13 -6
  25. data/lib/steep/interface/substitution.rb +11 -10
  26. data/lib/steep/project/dsl.rb +12 -4
  27. data/lib/steep/project/options.rb +3 -1
  28. data/lib/steep/signature/validator.rb +13 -13
  29. data/lib/steep/type_inference/logic_type_interpreter.rb +2 -2
  30. data/lib/steep/version.rb +1 -1
  31. data/lib/steep.rb +0 -1
  32. data/rbs_collection.steep.lock.yaml +44 -43
  33. data/sig/steep/ast/builtin.rbs +1 -1
  34. data/sig/steep/ast/types/any.rbs +5 -5
  35. data/sig/steep/ast/types/boolean.rbs +6 -6
  36. data/sig/steep/ast/types/bot.rbs +5 -5
  37. data/sig/steep/ast/types/class.rbs +7 -6
  38. data/sig/steep/ast/types/helper.rbs +2 -2
  39. data/sig/steep/ast/types/instance.rbs +6 -5
  40. data/sig/steep/ast/types/intersection.rbs +12 -9
  41. data/sig/steep/ast/types/literal.rbs +6 -4
  42. data/sig/steep/ast/types/logic.rbs +7 -9
  43. data/sig/steep/ast/types/name.rbs +7 -3
  44. data/sig/steep/ast/types/nil.rbs +6 -6
  45. data/sig/steep/ast/types/proc.rbs +8 -3
  46. data/sig/steep/ast/types/record.rbs +7 -8
  47. data/sig/steep/ast/types/self.rbs +7 -6
  48. data/sig/steep/ast/types/top.rbs +6 -6
  49. data/sig/steep/ast/types/tuple.rbs +5 -4
  50. data/sig/steep/ast/types/union.rbs +8 -8
  51. data/sig/steep/ast/types/var.rbs +16 -11
  52. data/sig/steep/ast/types/void.rbs +5 -5
  53. data/sig/steep/ast/types.rbs +5 -26
  54. data/sig/steep/index/rbs_index.rbs +83 -37
  55. data/sig/steep/interface/substitution.rbs +9 -9
  56. data/sig/steep/project/dsl.rbs +35 -30
  57. data/sig/steep/project/options.rbs +16 -4
  58. data/smoke/diagnostics-rbs/test_expectations.yml +1 -1
  59. data/steep.gemspec +3 -2
  60. metadata +21 -7
  61. data/lib/steep/ast/types.rb +0 -62
@@ -2,15 +2,13 @@ module Steep
2
2
  module AST
3
3
  module Types
4
4
  class Record
5
- type loc = RBS::Location[untyped, untyped]
6
-
7
5
  type key = Symbol | String | Integer
8
6
 
9
- attr_reader location: loc?
7
+ attr_reader location: untyped
10
8
 
11
9
  attr_reader elements: Hash[key, t]
12
10
 
13
- def initialize: (elements: Hash[key, t], ?location: loc?) -> void
11
+ def initialize: (elements: Hash[key, t], ?location: untyped) -> void
14
12
 
15
13
  def ==: (untyped other) -> bool
16
14
 
@@ -18,11 +16,12 @@ module Steep
18
16
 
19
17
  alias eql? ==
20
18
 
21
- def subst: (Interface::Substitution s) -> self
19
+ def subst: (Interface::Substitution s) -> Record
22
20
 
23
- def to_s: () -> ::String
21
+ def to_s: () -> String
24
22
 
25
- def free_variables: () -> Set[Symbol]
23
+ @fvs: Set[variable]
24
+ def free_variables: () -> Set[variable]
26
25
 
27
26
  include Helper::ChildrenLevel
28
27
 
@@ -31,7 +30,7 @@ module Steep
31
30
 
32
31
  def level: () -> Array[Integer]
33
32
 
34
- def with_location: (loc new_location) -> self
33
+ def with_location: (untyped new_location) -> Record
35
34
  end
36
35
  end
37
36
  end
@@ -6,23 +6,24 @@ module Steep
6
6
 
7
7
  def initialize: (?location: untyped?) -> void
8
8
 
9
- def ==: (untyped other) -> untyped
9
+ def ==: (untyped other) -> bool
10
10
 
11
- def hash: () -> untyped
11
+ def hash: () -> Integer
12
12
 
13
13
  alias eql? ==
14
14
 
15
- def to_s: () -> "self"
15
+ def to_s: () -> String
16
16
 
17
17
  include Helper::NoChild
18
18
 
19
- def subst: (untyped s) -> untyped
19
+ def subst: (Interface::Substitution s) -> t
20
20
 
21
- def free_variables: () -> untyped
21
+ @@fvs: Set[variable]
22
+ def free_variables: () -> Set[variable]
22
23
 
23
24
  def level: () -> Array[Integer]
24
25
 
25
- def with_location: (untyped new_location) -> untyped
26
+ def with_location: (untyped new_location) -> Self
26
27
 
27
28
  self.@instance: Self
28
29
  def self.instance: () -> Self
@@ -6,23 +6,23 @@ module Steep
6
6
 
7
7
  def initialize: (?location: untyped?) -> void
8
8
 
9
- def ==: (untyped other) -> untyped
9
+ def ==: (untyped other) -> bool
10
10
 
11
- def hash: () -> untyped
11
+ def hash: () -> Integer
12
12
 
13
13
  alias eql? ==
14
14
 
15
- def subst: (untyped s) -> self
15
+ def subst: (Interface::Substitution s) -> Top
16
16
 
17
- def to_s: () -> "top"
17
+ def to_s: () -> String
18
18
 
19
19
  include Helper::NoFreeVariables
20
20
 
21
21
  include Helper::NoChild
22
22
 
23
23
  def level: () -> Array[Integer]
24
-
25
- def with_location: (untyped new_location) -> untyped
24
+
25
+ def with_location: (untyped new_location) -> Top
26
26
  end
27
27
  end
28
28
  end
@@ -4,9 +4,9 @@ module Steep
4
4
  class Tuple
5
5
  attr_reader types: Array[t]
6
6
 
7
- attr_reader location: RBS::Location[untyped, untyped]?
7
+ attr_reader location: untyped
8
8
 
9
- def initialize: (types: Array[t], ?location: RBS::Location[untyped, untyped]?) -> void
9
+ def initialize: (types: Array[t], ?location: untyped) -> void
10
10
 
11
11
  def ==: (untyped other) -> bool
12
12
 
@@ -18,7 +18,8 @@ module Steep
18
18
 
19
19
  def to_s: () -> ::String
20
20
 
21
- def free_variables: () -> Set[Symbol]
21
+ @fvs: Set[variable]
22
+ def free_variables: () -> Set[variable]
22
23
 
23
24
  include Helper::ChildrenLevel
24
25
 
@@ -27,7 +28,7 @@ module Steep
27
28
 
28
29
  def level: () -> Array[Integer]
29
30
 
30
- def with_location: (RBS::Location[untyped, untyped] new_location) -> Tuple
31
+ def with_location: (untyped new_location) -> Tuple
31
32
  end
32
33
  end
33
34
  end
@@ -4,25 +4,25 @@ module Steep
4
4
  class Union
5
5
  attr_reader types: Array[t]
6
6
 
7
- type loc = RBS::Location[untyped, untyped]
7
+ attr_reader location: untyped
8
8
 
9
- attr_reader location: loc?
9
+ def initialize: (types: Array[t], ?location: untyped) -> void
10
10
 
11
- def initialize: (types: Array[t], ?location: loc?) -> void
12
-
13
- def self.build: (types: Array[t], ?location: loc?) -> t
11
+ def self.build: (types: Array[t], ?location: untyped) -> t
14
12
 
15
13
  def ==: (untyped other) -> bool
16
14
 
15
+ @hash: Integer
17
16
  def hash: () -> Integer
18
17
 
19
18
  alias eql? ==
20
19
 
21
- def subst: (Interface::Substitution s) -> Union
20
+ def subst: (Interface::Substitution s) -> t
22
21
 
23
22
  def to_s: () -> ::String
24
23
 
25
- def free_variables: () -> Set[Symbol]
24
+ @fvs: Set[variable]
25
+ def free_variables: () -> Set[variable]
26
26
 
27
27
  def each_child: () { (t) -> void } -> void
28
28
  | () -> Enumerator[t, void]
@@ -31,7 +31,7 @@ module Steep
31
31
 
32
32
  def level: () -> Array[Integer]
33
33
 
34
- def with_location: (loc new_location) -> Union
34
+ def with_location: (untyped new_location) -> Union
35
35
  end
36
36
  end
37
37
  end
@@ -1,36 +1,41 @@
1
1
  module Steep
2
2
  module AST
3
3
  module Types
4
+ # Type variables
4
5
  class Var
5
- attr_reader name: untyped
6
+ attr_reader name: Symbol
6
7
 
7
8
  attr_reader location: untyped
8
9
 
9
- def initialize: (name: untyped, ?location: untyped?) -> void
10
+ def initialize: (name: Symbol, ?location: untyped?) -> void
10
11
 
11
- def ==: (untyped other) -> untyped
12
+ def ==: (untyped other) -> bool
12
13
 
13
- def hash: () -> untyped
14
+ def hash: () -> Integer
14
15
 
15
16
  alias eql? ==
16
17
 
17
- def self.fresh_name: (untyped name) -> untyped
18
+ self.@mutex: Thread::Mutex
19
+ self.@max: Integer
20
+
21
+ def self.fresh_name: (Symbol name) -> Symbol
18
22
 
19
23
  def self.fresh: (Symbol name, ?location: untyped?) -> Var
20
24
 
21
- def to_s: () -> untyped
25
+ def to_s: () -> String
22
26
 
23
- def subst: (untyped s) -> (untyped | self)
27
+ def subst: (Interface::Substitution s) -> t
24
28
 
25
- def free_variables: () -> untyped
29
+ @fvs: Set[variable]
30
+ def free_variables: () -> Set[variable]
26
31
 
27
32
  include Helper::NoChild
28
33
 
29
34
  def level: () -> Array[Integer]
30
-
31
- def update: (?name: untyped, ?location: untyped) -> untyped
32
35
 
33
- def with_location: (untyped new_location) -> untyped
36
+ def update: (?name: Symbol, ?location: untyped) -> Var
37
+
38
+ def with_location: (untyped new_location) -> Var
34
39
  end
35
40
  end
36
41
  end
@@ -6,15 +6,15 @@ module Steep
6
6
 
7
7
  def initialize: (?location: untyped?) -> void
8
8
 
9
- def ==: (untyped other) -> untyped
9
+ def ==: (untyped other) -> bool
10
10
 
11
- def hash: () -> untyped
11
+ def hash: () -> Integer
12
12
 
13
13
  alias eql? ==
14
14
 
15
- def subst: (untyped s) -> self
15
+ def subst: (Interface::Substitution s) -> Void
16
16
 
17
- def to_s: () -> "void"
17
+ def to_s: () -> String
18
18
 
19
19
  include Helper::NoFreeVariables
20
20
 
@@ -22,7 +22,7 @@ module Steep
22
22
 
23
23
  def level: () -> Array[Integer]
24
24
 
25
- def with_location: (untyped new_location) -> untyped
25
+ def with_location: (untyped new_location) -> Void
26
26
  end
27
27
  end
28
28
  end
@@ -5,33 +5,12 @@ module Steep
5
5
  | Class | Instance | Self
6
6
  | Intersection | Record | Tuple | Union
7
7
  | Name::Alias | Name::Instance | Name::Interface | Name::Singleton
8
- | Proc | Var | Logic::Base
8
+ | Proc | Var
9
+ | Logic::Not | Logic::ReceiverIsNil | Logic::ReceiverIsNotNil | Logic::ReceiverIsArg | Logic::ArgIsReceiver | Logic::ArgEqualsReceiver | Logic::Env
9
10
 
10
- class Masked
11
- attr_reader location: untyped
12
-
13
- attr_reader type: untyped
14
-
15
- attr_reader mask: untyped
16
-
17
- def initialize: (type: untyped, mask: untyped, location: untyped) -> void
18
-
19
- def ==: (untyped other) -> untyped
20
-
21
- alias eql? ==
22
-
23
- def hash: () -> untyped
24
-
25
- def to_json: (*untyped a) -> untyped
26
-
27
- def to_s: (?::Integer level) -> ::String
28
-
29
- def free_variables: () -> untyped
30
-
31
- def each_type: () { (untyped) -> untyped } -> untyped
32
-
33
- def sub: (untyped s) -> untyped
34
- end
11
+ # Variables and special types that is subject for substitution
12
+ #
13
+ type variable = Symbol | Class | Instance | Self
35
14
  end
36
15
  end
37
16
  end
@@ -2,89 +2,135 @@ module Steep
2
2
  module Index
3
3
  class RBSIndex
4
4
  class TypeEntry
5
- attr_reader type_name: untyped
5
+ attr_reader type_name: RBS::TypeName
6
6
 
7
- attr_reader declarations: untyped
7
+ type decl = RBS::AST::Declarations::Class
8
+ | RBS::AST::Declarations::Module
9
+ | RBS::AST::Declarations::Interface
10
+ | RBS::AST::Declarations::Alias
8
11
 
9
- attr_reader references: untyped
12
+ type ref = RBS::AST::Members::MethodDefinition
13
+ | RBS::AST::Members::AttrWriter
14
+ | RBS::AST::Members::AttrReader
15
+ | RBS::AST::Members::AttrAccessor
16
+ | RBS::AST::Members::Include
17
+ | RBS::AST::Members::Extend
18
+ | RBS::AST::Members::InstanceVariable
19
+ | RBS::AST::Members::ClassVariable
20
+ | RBS::AST::Members::ClassInstanceVariable
21
+ | RBS::AST::Declarations::Module
22
+ | RBS::AST::Declarations::Class
23
+ | RBS::AST::Declarations::Constant
24
+ | RBS::AST::Declarations::Global
25
+ | RBS::AST::Declarations::Alias
10
26
 
11
- def initialize: (type_name: untyped) -> void
27
+ attr_reader declarations: Set[decl]
12
28
 
13
- def add_declaration: (untyped decl) -> untyped
29
+ attr_reader references: Set[ref]
14
30
 
15
- def add_reference: (untyped ref) -> untyped
31
+ def initialize: (type_name: RBS::TypeName) -> void
32
+
33
+ def add_declaration: (decl decl) -> self
34
+
35
+ def add_reference: (ref) -> self
16
36
  end
17
37
 
18
38
  class MethodEntry
19
- attr_reader method_name: untyped
39
+ attr_reader method_name: method_name
40
+
41
+ type decl = RBS::AST::Members::MethodDefinition
42
+ | RBS::AST::Members::Alias
43
+ | RBS::AST::Members::AttrWriter
44
+ | RBS::AST::Members::AttrReader
45
+ | RBS::AST::Members::AttrAccessor
20
46
 
21
- attr_reader declarations: untyped
47
+ type ref = RBS::AST::Members::Alias
22
48
 
23
- attr_reader references: untyped
49
+ attr_reader declarations: Set[decl]
24
50
 
25
- def initialize: (method_name: untyped) -> void
51
+ attr_reader references: Set[ref]
26
52
 
27
- def add_declaration: (untyped decl) -> untyped
53
+ def initialize: (method_name: method_name) -> void
54
+
55
+ def add_declaration: (decl) -> self
28
56
  end
29
57
 
30
58
  class ConstantEntry
31
- attr_reader const_name: untyped
59
+ attr_reader const_name: RBS::TypeName
60
+
61
+ type decl = RBS::AST::Declarations::Constant
32
62
 
33
- attr_reader declarations: untyped
63
+ attr_reader declarations: Set[decl]
34
64
 
35
- def initialize: (const_name: untyped) -> void
65
+ def initialize: (const_name: RBS::TypeName) -> void
36
66
 
37
- def add_declaration: (untyped decl) -> untyped
67
+ def add_declaration: (decl) -> self
38
68
  end
39
69
 
40
70
  class GlobalEntry
41
- attr_reader global_name: untyped
71
+ attr_reader global_name: Symbol
72
+
73
+ type decl = RBS::AST::Declarations::Global
42
74
 
43
- attr_reader declarations: untyped
75
+ attr_reader declarations: Set[decl]
44
76
 
45
- def initialize: (global_name: untyped) -> void
77
+ def initialize: (global_name: Symbol) -> void
46
78
 
47
- def add_declaration: (untyped decl) -> untyped
79
+ def add_declaration: (decl) -> self
48
80
  end
49
81
 
50
- attr_reader type_index: untyped
82
+ attr_reader type_index: Hash[RBS::TypeName, TypeEntry]
51
83
 
52
- attr_reader method_index: untyped
84
+ attr_reader method_index: Hash[method_name, MethodEntry]
53
85
 
54
- attr_reader const_index: untyped
86
+ attr_reader const_index: Hash[RBS::TypeName, ConstantEntry]
55
87
 
56
- attr_reader global_index: untyped
88
+ attr_reader global_index: Hash[Symbol, GlobalEntry]
57
89
 
58
90
  def initialize: () -> void
59
91
 
60
- def entry: (?type_name: untyped?, ?method_name: untyped?, ?const_name: untyped?, ?global_name: untyped?) -> untyped
92
+ def entry: (type_name: RBS::TypeName) -> TypeEntry
93
+ | (method_name: method_name) -> MethodEntry
94
+ | (const_name: RBS::TypeName) -> ConstantEntry
95
+ | (global_name: Symbol) -> GlobalEntry
61
96
 
62
- def each_entry: () { () -> untyped } -> untyped
97
+ def each_entry: () { (TypeEntry | MethodEntry | ConstantEntry | GlobalEntry) -> void } -> void
98
+ | () -> Enumerator[TypeEntry | MethodEntry | ConstantEntry | GlobalEntry, void]
63
99
 
64
- def add_type_declaration: (untyped type_name, untyped declaration) -> untyped
100
+ def add_type_declaration: (RBS::TypeName type_name, TypeEntry::decl declaration) -> TypeEntry
65
101
 
66
- def add_method_declaration: (untyped method_name, untyped member) -> untyped
102
+ def add_method_declaration: (method_name, MethodEntry::decl member) -> MethodEntry
67
103
 
68
- def add_constant_declaration: (untyped const_name, untyped decl) -> untyped
104
+ def add_constant_declaration: (RBS::TypeName const_name, ConstantEntry::decl decl) -> ConstantEntry
69
105
 
70
- def add_global_declaration: (untyped global_name, untyped decl) -> untyped
106
+ def add_global_declaration: (Symbol global_name, GlobalEntry::decl decl) -> GlobalEntry
71
107
 
72
- def each_declaration: (?type_name: untyped?, ?method_name: untyped?, ?const_name: untyped?, ?global_name: untyped?) { () -> untyped } -> untyped
108
+ def each_declaration: (type_name: RBS::TypeName) { (TypeEntry) -> void } -> void
109
+ | (type_name: RBS::TypeName) -> Enumerator[TypeEntry, void]
110
+ | (method_name: method_name) { (MethodEntry) -> void } -> void
111
+ | (method_name: method_name) -> Enumerator[MethodEntry, void]
112
+ | (const_name: RBS::TypeName) { (ConstantEntry) -> void } -> void
113
+ | (const_name: RBS::TypeName) -> Enumerator[ConstantEntry, void]
114
+ | (global_name: Symbol) { (GlobalEntry) -> void } -> void
115
+ | (global_name: Symbol) -> Enumerator[GlobalEntry, void]
73
116
 
74
- def add_type_reference: (untyped type_name, untyped ref) -> untyped
117
+ # `type_name` is referred from `ref`
118
+ #
119
+ def add_type_reference: (RBS::TypeName type_name, TypeEntry::ref ref) -> TypeEntry
75
120
 
76
- def each_reference: (?type_name: untyped?) { () -> untyped } -> untyped
121
+ def each_reference: (type_name: RBS::TypeName) { (TypeEntry::ref) -> void } -> void
122
+ | (type_name: RBS::TypeName) -> Enumerator[TypeEntry::ref, void]
77
123
 
78
124
  class Builder
79
- attr_reader index: untyped
125
+ attr_reader index: RBSIndex
80
126
 
81
- def initialize: (index: untyped) -> void
127
+ def initialize: (index: RBSIndex) -> void
82
128
 
83
- def member: (untyped type_name, untyped member) -> untyped
129
+ def member: (RBS::TypeName type_name, RBS::AST::Members::t | RBS::AST::Declarations::t member) -> void
84
130
 
85
- def type_reference: (untyped `type`, from: untyped) -> untyped
131
+ def type_reference: (RBS::Types::t, from: TypeEntry::ref) -> void
86
132
 
87
- def env: (untyped env) -> untyped
133
+ def env: (RBS::Environment env) -> void
88
134
  end
89
135
  end
90
136
  end
@@ -2,28 +2,28 @@ module Steep
2
2
  module Interface
3
3
  class Substitution
4
4
  class InvalidSubstitutionError < StandardError
5
- attr_reader vars_size: untyped
5
+ attr_reader vars_size: Integer
6
6
 
7
- attr_reader types_size: untyped
7
+ attr_reader types_size: Integer
8
8
 
9
- def initialize: (vars_size: untyped, types_size: untyped) -> void
9
+ def initialize: (vars_size: Integer, types_size: Integer) -> void
10
10
  end
11
11
 
12
12
  attr_reader dictionary: Hash[Symbol, AST::Types::t]
13
13
 
14
- attr_reader instance_type: AST::Types::t
14
+ attr_reader instance_type: AST::Types::t?
15
15
 
16
- attr_reader module_type: AST::Types::t
16
+ attr_reader module_type: AST::Types::t?
17
17
 
18
- attr_reader self_type: AST::Types::t
18
+ attr_reader self_type: AST::Types::t?
19
19
 
20
- def initialize: (dictionary: Hash[Symbol, AST::Types::t], instance_type: AST::Types::t, module_type: AST::Types::t, self_type: AST::Types::t) -> void
20
+ def initialize: (dictionary: Hash[Symbol, AST::Types::t], instance_type: AST::Types::t?, module_type: AST::Types::t?, self_type: AST::Types::t?) -> void
21
21
 
22
22
  def self.empty: () -> instance
23
23
 
24
24
  def empty?: () -> bool
25
25
 
26
- def domain: () -> Set[AST::Types::t | Symbol]
26
+ def domain: () -> Set[AST::Types::variable]
27
27
 
28
28
  def to_s: () -> ::String
29
29
 
@@ -31,7 +31,7 @@ module Steep
31
31
 
32
32
  def key?: (Symbol var) -> bool
33
33
 
34
- def self.build: (Array[Symbol] vars, ?Array[AST::Types::t]? types, ?instance_type: AST::Types::t, ?module_type: AST::Types::t, ?self_type: AST::Types::t) -> Substitution
34
+ def self.build: (Array[Symbol] vars, ?Array[AST::Types::t]? types, ?instance_type: AST::Types::t?, ?module_type: AST::Types::t?, ?self_type: AST::Types::t?) -> Substitution
35
35
 
36
36
  def except: (Array[Symbol] vars) -> Substitution
37
37
 
@@ -2,53 +2,55 @@ module Steep
2
2
  class Project
3
3
  class DSL
4
4
  class TargetDSL
5
- attr_reader name: untyped
5
+ attr_reader name: Symbol
6
6
 
7
- attr_reader sources: untyped
7
+ attr_reader sources: Array[String]
8
8
 
9
- attr_reader libraries: untyped
9
+ attr_reader libraries: Array[String]
10
10
 
11
- attr_reader signatures: untyped
11
+ attr_reader signatures: Array[String]
12
12
 
13
- attr_reader ignored_sources: untyped
13
+ attr_reader ignored_sources: Array[String]
14
14
 
15
- attr_reader stdlib_root: untyped
15
+ attr_reader stdlib_root: Pathname?
16
16
 
17
- attr_reader core_root: untyped
17
+ attr_reader core_root: Pathname?
18
18
 
19
- attr_reader repo_paths: untyped
19
+ attr_reader repo_paths: Array[Pathname]
20
20
 
21
21
  attr_reader code_diagnostics_config: untyped
22
22
 
23
- attr_reader project: untyped
23
+ attr_reader project: Project?
24
24
 
25
- attr_reader collection_config_path: untyped
25
+ attr_reader collection_config_path: Pathname?
26
26
 
27
27
  NONE: untyped
28
28
 
29
- def initialize: (untyped name, ?sources: untyped, ?libraries: untyped, ?signatures: untyped, ?ignored_sources: untyped, ?repo_paths: untyped, ?code_diagnostics_config: ::Hash[untyped, untyped], ?project: untyped?, ?collection_config_path: untyped) -> void
29
+ def project!: () -> Project
30
30
 
31
- def initialize_copy: (untyped other) -> untyped
31
+ def initialize: (Symbol name, ?sources: Array[String], ?libraries: Array[String], ?signatures: Array[String], ?ignored_sources: Array[String], ?repo_paths: Array[Pathname], ?code_diagnostics_config: ::Hash[untyped, untyped], ?project: Project?, ?collection_config_path: Pathname?) -> void
32
32
 
33
- def check: (*untyped args) -> untyped
33
+ def initialize_copy: (instance other) -> void
34
34
 
35
- def ignore: (*untyped args) -> untyped
35
+ def check: (*String args) -> void
36
36
 
37
- def library: (*untyped args) -> untyped
37
+ def ignore: (*String args) -> void
38
38
 
39
- def typing_options: (?untyped? level, **untyped hash) -> untyped
39
+ def library: (*String args) -> void
40
40
 
41
- def signature: (*untyped args) -> untyped
41
+ def typing_options: (?untyped level, **untyped hash) -> void
42
42
 
43
- def update: (?name: untyped, ?sources: untyped, ?libraries: untyped, ?ignored_sources: untyped, ?signatures: untyped, ?project: untyped) -> untyped
43
+ def signature: (*String args) -> void
44
44
 
45
- def no_builtin!: (?bool value) -> untyped
45
+ def update: (?name: Symbol, ?sources: Array[String], ?libraries: Array[String], ?signatures: Array[String], ?ignored_sources: Array[String], ?project: Project?) -> TargetDSL
46
46
 
47
- def vendor: (?::String dir, ?stdlib: untyped?, ?gems: untyped?) -> untyped
47
+ def no_builtin!: (?bool value) -> void
48
48
 
49
- def stdlib_path: (core_root: untyped, stdlib_root: untyped) -> untyped
49
+ def vendor: (?::String dir, ?stdlib: untyped?, ?gems: untyped?) -> void
50
50
 
51
- def repo_path: (*untyped paths) -> untyped
51
+ def stdlib_path: (core_root: String, stdlib_root: String) -> void
52
+
53
+ def repo_path: (*String paths) -> void
52
54
 
53
55
  # Configure the code diagnostics printing setup.
54
56
  #
@@ -71,24 +73,27 @@ module Steep
71
73
  # configure_code_diagnostics(D::Ruby.lenient)
72
74
  # ```
73
75
  #
74
- def configure_code_diagnostics: (?untyped? hash) { (untyped) -> untyped } -> untyped
76
+ def configure_code_diagnostics: (Hash[untyped, untyped] hash) -> void
77
+ | () { (Hash[untyped, untyped]) -> void } -> void
75
78
 
76
- def collection_config: (untyped path) -> untyped
79
+ def collection_config: (Pathname path) -> void
77
80
 
78
- def disable_collection: () -> untyped
81
+ def disable_collection: () -> void
79
82
  end
80
83
 
81
84
  attr_reader project: untyped
82
85
 
83
- def self.templates: () -> untyped
86
+ @@templates: Hash[Symbol, TargetDSL]
87
+
88
+ def self.templates: () -> Hash[Symbol, TargetDSL]
84
89
 
85
- def initialize: (project: untyped) -> void
90
+ def initialize: (project: Project) -> void
86
91
 
87
- def self.register_template: (untyped name, untyped target) -> untyped
92
+ def self.register_template: (Symbol name, TargetDSL target) -> void
88
93
 
89
- def self.parse: (untyped project, untyped code, ?filename: ::String) -> untyped
94
+ def self.parse: (Project project, String code, ?filename: String) -> void
90
95
 
91
- def target: (untyped name, ?template: untyped?) ?{ () -> untyped } -> untyped
96
+ def target: (Symbol name, ?template: Symbol?) ?{ (TargetDSL) [self: TargetDSL] -> void } -> void
92
97
  end
93
98
  end
94
99
  end
@@ -1,13 +1,25 @@
1
1
  module Steep
2
2
  class Project
3
3
  class Options
4
- PathOptions: untyped
4
+ class PathOptions
5
+ attr_reader core_root: Pathname?
5
6
 
6
- attr_reader libraries: untyped
7
+ attr_reader stdlib_root: Pathname?
7
8
 
8
- attr_accessor paths: untyped
9
+ attr_reader repo_paths: Array[Pathname]
9
10
 
10
- attr_accessor collection_lock: untyped
11
+ def initialize: (?core_root: Pathname?, ?stdlib_root: Pathname?, ?repo_paths: Array[Pathname]) -> void
12
+
13
+ def customized_stdlib?: () -> bool
14
+
15
+ def customized_core?: () -> bool
16
+ end
17
+
18
+ attr_reader libraries: Array[String]
19
+
20
+ attr_accessor paths: PathOptions
21
+
22
+ attr_accessor collection_lock: RBS::Collection::Config::Lockfile
11
23
 
12
24
  def initialize: () -> void
13
25
  end