steep 1.3.0.pre.2 → 1.3.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 (53) 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 +12 -0
  5. data/Gemfile.lock +20 -18
  6. data/Gemfile.steep +1 -2
  7. data/Gemfile.steep.lock +4 -5
  8. data/bin/rbs +21 -0
  9. data/bin/setup +1 -1
  10. data/lib/steep/ast/types/class.rb +9 -3
  11. data/lib/steep/ast/types/factory.rb +9 -2
  12. data/lib/steep/ast/types/instance.rb +8 -3
  13. data/lib/steep/ast/types/intersection.rb +6 -2
  14. data/lib/steep/ast/types/literal.rb +1 -1
  15. data/lib/steep/ast/types/logic.rb +1 -3
  16. data/lib/steep/ast/types/name.rb +11 -5
  17. data/lib/steep/ast/types/proc.rb +5 -5
  18. data/lib/steep/ast/types/record.rb +5 -1
  19. data/lib/steep/ast/types/self.rb +8 -2
  20. data/lib/steep/ast/types/tuple.rb +7 -5
  21. data/lib/steep/ast/types/union.rb +10 -4
  22. data/lib/steep/ast/types/var.rb +1 -1
  23. data/lib/steep/interface/substitution.rb +11 -10
  24. data/lib/steep/signature/validator.rb +13 -13
  25. data/lib/steep/type_inference/logic_type_interpreter.rb +2 -2
  26. data/lib/steep/version.rb +1 -1
  27. data/lib/steep.rb +0 -1
  28. data/rbs_collection.steep.lock.yaml +20 -12
  29. data/sig/steep/ast/builtin.rbs +1 -1
  30. data/sig/steep/ast/types/any.rbs +5 -5
  31. data/sig/steep/ast/types/boolean.rbs +6 -6
  32. data/sig/steep/ast/types/bot.rbs +5 -5
  33. data/sig/steep/ast/types/class.rbs +7 -6
  34. data/sig/steep/ast/types/helper.rbs +2 -2
  35. data/sig/steep/ast/types/instance.rbs +6 -5
  36. data/sig/steep/ast/types/intersection.rbs +12 -9
  37. data/sig/steep/ast/types/literal.rbs +6 -4
  38. data/sig/steep/ast/types/logic.rbs +7 -9
  39. data/sig/steep/ast/types/name.rbs +7 -3
  40. data/sig/steep/ast/types/nil.rbs +6 -6
  41. data/sig/steep/ast/types/proc.rbs +8 -3
  42. data/sig/steep/ast/types/record.rbs +7 -8
  43. data/sig/steep/ast/types/self.rbs +7 -6
  44. data/sig/steep/ast/types/top.rbs +6 -6
  45. data/sig/steep/ast/types/tuple.rbs +5 -4
  46. data/sig/steep/ast/types/union.rbs +8 -8
  47. data/sig/steep/ast/types/var.rbs +16 -11
  48. data/sig/steep/ast/types/void.rbs +5 -5
  49. data/sig/steep/ast/types.rbs +5 -26
  50. data/sig/steep/interface/substitution.rbs +9 -9
  51. data/steep.gemspec +3 -2
  52. metadata +25 -11
  53. data/lib/steep/ast/types.rb +0 -62
@@ -11,7 +11,7 @@ gems:
11
11
  source:
12
12
  type: stdlib
13
13
  - name: rbs
14
- version: 2.8.0.pre.1
14
+ version: 2.8.0
15
15
  source:
16
16
  type: rubygems
17
17
  - name: dbm
@@ -19,11 +19,11 @@ gems:
19
19
  source:
20
20
  type: stdlib
21
21
  - name: activesupport
22
- version: '6.0'
22
+ version: '7.0'
23
23
  source:
24
24
  type: git
25
25
  name: ruby/gem_rbs_collection
26
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
26
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
27
27
  remote: https://github.com/ruby/gem_rbs_collection.git
28
28
  repo_dir: gems
29
29
  - name: ast
@@ -31,7 +31,15 @@ gems:
31
31
  source:
32
32
  type: git
33
33
  name: ruby/gem_rbs_collection
34
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
34
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
35
+ remote: https://github.com/ruby/gem_rbs_collection.git
36
+ repo_dir: gems
37
+ - name: concurrent-ruby
38
+ version: '1.1'
39
+ source:
40
+ type: git
41
+ name: ruby/gem_rbs_collection
42
+ revision: 8f2be26c03ad81a7124927ebc4f8e066ba94b92b
35
43
  remote: https://github.com/ruby/gem_rbs_collection.git
36
44
  repo_dir: gems
37
45
  - name: csv
@@ -47,7 +55,7 @@ gems:
47
55
  source:
48
56
  type: git
49
57
  name: ruby/gem_rbs_collection
50
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
58
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
51
59
  remote: https://github.com/ruby/gem_rbs_collection.git
52
60
  repo_dir: gems
53
61
  - name: json
@@ -59,7 +67,7 @@ gems:
59
67
  source:
60
68
  type: git
61
69
  name: ruby/gem_rbs_collection
62
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
70
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
63
71
  remote: https://github.com/ruby/gem_rbs_collection.git
64
72
  repo_dir: gems
65
73
  - name: logger
@@ -75,7 +83,7 @@ gems:
75
83
  source:
76
84
  type: git
77
85
  name: ruby/gem_rbs_collection
78
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
86
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
79
87
  remote: https://github.com/ruby/gem_rbs_collection.git
80
88
  repo_dir: gems
81
89
  - name: rainbow
@@ -83,7 +91,7 @@ gems:
83
91
  source:
84
92
  type: git
85
93
  name: ruby/gem_rbs_collection
86
- revision: 94fcc911186b127cffdfd7a378b5e0b511196089
94
+ revision: 3cdcbea7f7a2a2ba5dffce3ee71f938f8b301687
87
95
  remote: https://github.com/ruby/gem_rbs_collection.git
88
96
  repo_dir: gems
89
97
  - name: securerandom
@@ -110,19 +118,19 @@ gems:
110
118
  version: '0'
111
119
  source:
112
120
  type: stdlib
113
- - name: monitor
121
+ - name: date
114
122
  version: '0'
115
123
  source:
116
124
  type: stdlib
117
- - name: date
125
+ - name: monitor
118
126
  version: '0'
119
127
  source:
120
128
  type: stdlib
121
- - name: singleton
129
+ - name: mutex_m
122
130
  version: '0'
123
131
  source:
124
132
  type: stdlib
125
- - name: mutex_m
133
+ - name: singleton
126
134
  version: '0'
127
135
  source:
128
136
  type: stdlib
@@ -59,7 +59,7 @@ module Steep
59
59
 
60
60
  def self.top_type: () -> Types::Top
61
61
 
62
- def self.optional: (Types::t `type`) -> Types::Union
62
+ def self.optional: (Types::t) -> Types::t
63
63
 
64
64
  def self.true_type: () -> Types::Literal
65
65
 
@@ -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) -> Any
16
16
 
17
- def to_s: () -> "untyped"
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) -> Any
26
26
  end
27
27
  end
28
28
  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) -> Boolean
16
16
 
17
- def to_s: () -> "bool"
17
+ def to_s: () -> String
18
18
 
19
19
  include Helper::NoFreeVariables
20
20
 
@@ -22,9 +22,9 @@ 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) -> Boolean
26
26
 
27
- def back_type: () -> untyped
27
+ def back_type: () -> t
28
28
  end
29
29
  end
30
30
  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) -> Bot
16
16
 
17
- def to_s: () -> "bot"
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) -> Bot
26
26
  end
27
27
  end
28
28
  end
@@ -6,23 +6,24 @@ module Steep
6
6
 
7
7
  def initialize: (?location: untyped?) -> void
8
8
 
9
- def to_s: () -> "class"
9
+ def to_s: () -> String
10
10
 
11
- def ==: (untyped other) -> untyped
11
+ def ==: (untyped other) -> bool
12
12
 
13
- def hash: () -> untyped
13
+ def hash: () -> Integer
14
14
 
15
15
  alias eql? ==
16
16
 
17
- def subst: (untyped s) -> untyped
17
+ def subst: (Interface::Substitution s) -> t
18
18
 
19
- def free_variables: () -> untyped
19
+ @@fvs: Set[variable]
20
+ def free_variables: () -> Set[variable]
20
21
 
21
22
  include Helper::NoChild
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) -> Class
26
27
 
27
28
  self.@instance: Class
28
29
  def self.instance: () -> Class
@@ -7,9 +7,9 @@ module Steep
7
7
  end
8
8
 
9
9
  module NoFreeVariables
10
- @fvs: Set[Symbol]
10
+ @fvs: Set[variable]
11
11
 
12
- def free_variables: () -> Set[Symbol]
12
+ def free_variables: () -> Set[variable]
13
13
  end
14
14
 
15
15
  module NoChild
@@ -6,19 +6,20 @@ 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) -> untyped
15
+ def subst: (Interface::Substitution s) -> t
16
16
 
17
- def free_variables: () -> untyped
17
+ @@fvs: Set[variable]
18
+ def free_variables: () -> Set[variable]
18
19
 
19
20
  include Helper::NoChild
20
21
 
21
- def to_s: () -> "instance"
22
+ def to_s: () -> String
22
23
 
23
24
  def level: () -> Array[Integer]
24
25
 
@@ -2,33 +2,36 @@ module Steep
2
2
  module AST
3
3
  module Types
4
4
  class Intersection
5
- attr_reader types: untyped
5
+ attr_reader types: Array[t]
6
6
 
7
7
  attr_reader location: untyped
8
8
 
9
- def initialize: (types: untyped, ?location: untyped?) -> void
9
+ def initialize: (types: Array[t], ?location: untyped?) -> void
10
10
 
11
11
  def self.build: (types: Array[t], ?location: untyped?) -> t
12
12
 
13
- def ==: (untyped other) -> untyped
13
+ def ==: (untyped other) -> bool
14
14
 
15
- def hash: () -> untyped
15
+ @hash: Integer
16
+ def hash: () -> Integer
16
17
 
17
18
  alias eql? ==
18
19
 
19
- def subst: (untyped s) -> untyped
20
+ def subst: (Interface::Substitution s) -> t
20
21
 
21
- def to_s: () -> ::String
22
+ def to_s: () -> String
22
23
 
23
- def free_variables: () -> untyped
24
+ @fvs: Set[variable]
25
+ def free_variables: () -> Set[variable]
24
26
 
25
27
  include Helper::ChildrenLevel
26
28
 
27
- def each_child: () ?{ () -> untyped } -> untyped
29
+ def each_child: () { (t) -> void } -> void
30
+ | () -> Enumerator[t, void]
28
31
 
29
32
  def level: () -> Array[Integer]
30
33
 
31
- def with_location: (untyped new_location) -> untyped
34
+ def with_location: (untyped new_location) -> Intersection
32
35
  end
33
36
  end
34
37
  end
@@ -4,9 +4,11 @@ module Steep
4
4
  class Literal
5
5
  attr_reader location: untyped
6
6
 
7
- attr_reader value: untyped
7
+ type value = Integer | String | Symbol | TrueClass | FalseClass
8
8
 
9
- def initialize: (value: untyped, ?location: untyped?) -> void
9
+ attr_reader value: value
10
+
11
+ def initialize: (value: value, ?location: untyped?) -> void
10
12
 
11
13
  def ==: (untyped other) -> bool
12
14
 
@@ -14,7 +16,7 @@ module Steep
14
16
 
15
17
  alias eql? ==
16
18
 
17
- def subst: (Interface::Substitution s) -> self
19
+ def subst: (Interface::Substitution s) -> Literal
18
20
 
19
21
  def to_s: () -> String
20
22
 
@@ -24,7 +26,7 @@ module Steep
24
26
 
25
27
  def level: () -> Array[Integer]
26
28
 
27
- def with_location: (untyped new_location) -> self
29
+ def with_location: (untyped new_location) -> Literal
28
30
 
29
31
  def back_type: () -> AST::Types::Name::Instance
30
32
  end
@@ -2,24 +2,22 @@ module Steep
2
2
  module AST
3
3
  module Types
4
4
  module Logic
5
- type loc = RBS::Location[untyped, untyped]
6
-
7
5
  class Base
8
6
  attr_reader location: untyped
9
7
 
10
- def subst: (untyped s) -> self
8
+ def subst: (Interface::Substitution s) -> self
11
9
 
12
- def free_variables: () -> untyped
10
+ include Helper::NoFreeVariables
13
11
 
14
12
  include Helper::NoChild
15
13
 
16
- def hash: () -> untyped
14
+ def hash: () -> Integer
17
15
 
18
- def ==: (untyped other) -> untyped
16
+ def ==: (untyped other) -> bool
19
17
 
20
18
  alias eql? ==
21
19
 
22
- def to_s: () -> ::String
20
+ def to_s: () -> String
23
21
 
24
22
  def level: () -> Array[Integer]
25
23
  end
@@ -62,7 +60,7 @@ module Steep
62
60
 
63
61
  attr_reader type: t
64
62
 
65
- def initialize: (truthy: TypeInference::TypeEnv, falsy: TypeInference::TypeEnv, type: t, ?location: loc?) -> void
63
+ def initialize: (truthy: TypeInference::TypeEnv, falsy: TypeInference::TypeEnv, type: t, ?location: untyped) -> void
66
64
 
67
65
  def ==: (untyped other) -> bool
68
66
 
@@ -70,7 +68,7 @@ module Steep
70
68
 
71
69
  def hash: () -> Integer
72
70
 
73
- def inspect: () -> ::String
71
+ def inspect: () -> String
74
72
 
75
73
  alias to_s inspect
76
74
  end
@@ -1,6 +1,8 @@
1
1
  module Steep
2
2
  module AST
3
3
  module Types
4
+ # Types with names
5
+ #
4
6
  module Name
5
7
  class Base
6
8
  attr_reader location: untyped
@@ -25,15 +27,17 @@ module Steep
25
27
 
26
28
  alias eql? ==
27
29
 
30
+ @hash: Integer
28
31
  def hash: () -> Integer
29
32
 
30
33
  def to_s: () -> ::String
31
34
 
32
- def with_location: (untyped new_location) -> untyped
35
+ def with_location: (untyped new_location) -> self
33
36
 
34
37
  def subst: (Steep::Interface::Substitution s) -> self
35
38
 
36
- def free_variables: () -> Set[Symbol]
39
+ @fvs: Set[variable]
40
+ def free_variables: () -> Set[variable]
37
41
 
38
42
  def each_child: () { (t) -> void } -> void
39
43
  | () -> Enumerator[t, void]
@@ -52,7 +56,7 @@ module Steep
52
56
 
53
57
  def to_s: () -> ::String
54
58
 
55
- def with_location: (untyped new_location) -> untyped
59
+ def with_location: (untyped new_location) -> Singleton
56
60
 
57
61
  include Helper::NoChild
58
62
  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) -> Nil
16
16
 
17
- def to_s: () -> "nil"
17
+ def to_s: () -> String
18
18
 
19
19
  include Helper::NoFreeVariables
20
20
 
@@ -22,9 +22,9 @@ 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) -> Nil
26
26
 
27
- def back_type: () -> untyped
27
+ def back_type: () -> Name::Instance
28
28
  end
29
29
  end
30
30
  end
@@ -22,18 +22,23 @@ module Steep
22
22
 
23
23
  def to_s: () -> ::String
24
24
 
25
- def free_variables: () -> Set[Symbol]
25
+ @fvs: Set[variable]
26
+ def free_variables: () -> Set[variable]
26
27
 
27
28
  include Helper::ChildrenLevel
28
29
 
29
30
  def level: () -> Array[Integer]
30
31
 
31
- def closed?: () -> bool
32
-
33
32
  def with_location: (untyped new_location) -> Proc
34
33
 
35
34
  def map_type: () { (AST::Types::t) -> AST::Types::t } -> Proc
36
35
 
36
+ # Returns true if the proc requires exactly one argument
37
+ #
38
+ # * One required argument,
39
+ # * No optional/rest argument, and
40
+ # * No keywords
41
+ #
37
42
  def one_arg?: () -> bool
38
43
 
39
44
  def back_type: () -> AST::Types::t
@@ -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