steep 1.3.0.pre.2 → 1.3.0

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +3 -3
  4. data/Gemfile.steep +1 -2
  5. data/Gemfile.steep.lock +4 -5
  6. data/lib/steep/ast/types/class.rb +9 -3
  7. data/lib/steep/ast/types/factory.rb +9 -2
  8. data/lib/steep/ast/types/instance.rb +8 -3
  9. data/lib/steep/ast/types/intersection.rb +6 -2
  10. data/lib/steep/ast/types/literal.rb +1 -1
  11. data/lib/steep/ast/types/logic.rb +1 -3
  12. data/lib/steep/ast/types/name.rb +11 -5
  13. data/lib/steep/ast/types/proc.rb +5 -5
  14. data/lib/steep/ast/types/record.rb +5 -1
  15. data/lib/steep/ast/types/self.rb +8 -2
  16. data/lib/steep/ast/types/tuple.rb +7 -5
  17. data/lib/steep/ast/types/union.rb +10 -4
  18. data/lib/steep/ast/types/var.rb +1 -1
  19. data/lib/steep/interface/substitution.rb +11 -10
  20. data/lib/steep/signature/validator.rb +13 -13
  21. data/lib/steep/type_inference/logic_type_interpreter.rb +2 -2
  22. data/lib/steep/version.rb +1 -1
  23. data/lib/steep.rb +0 -1
  24. data/rbs_collection.steep.lock.yaml +1 -1
  25. data/sig/steep/ast/builtin.rbs +1 -1
  26. data/sig/steep/ast/types/any.rbs +5 -5
  27. data/sig/steep/ast/types/boolean.rbs +6 -6
  28. data/sig/steep/ast/types/bot.rbs +5 -5
  29. data/sig/steep/ast/types/class.rbs +7 -6
  30. data/sig/steep/ast/types/helper.rbs +2 -2
  31. data/sig/steep/ast/types/instance.rbs +6 -5
  32. data/sig/steep/ast/types/intersection.rbs +12 -9
  33. data/sig/steep/ast/types/literal.rbs +6 -4
  34. data/sig/steep/ast/types/logic.rbs +7 -9
  35. data/sig/steep/ast/types/name.rbs +7 -3
  36. data/sig/steep/ast/types/nil.rbs +6 -6
  37. data/sig/steep/ast/types/proc.rbs +8 -3
  38. data/sig/steep/ast/types/record.rbs +7 -8
  39. data/sig/steep/ast/types/self.rbs +7 -6
  40. data/sig/steep/ast/types/top.rbs +6 -6
  41. data/sig/steep/ast/types/tuple.rbs +5 -4
  42. data/sig/steep/ast/types/union.rbs +8 -8
  43. data/sig/steep/ast/types/var.rbs +16 -11
  44. data/sig/steep/ast/types/void.rbs +5 -5
  45. data/sig/steep/ast/types.rbs +5 -26
  46. data/sig/steep/interface/substitution.rbs +9 -9
  47. data/steep.gemspec +1 -1
  48. metadata +6 -7
  49. data/lib/steep/ast/types.rb +0 -62
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 639a97319d661c777702365209eaf5a6ea2632723a509331a03f6f1ef3926148
4
- data.tar.gz: fb6061b52a09fb97c907abff4f69d6c9267eef1c9a3af52fa87fffda9de5d1f0
3
+ metadata.gz: f878620b37610ff6bb38ba9f71c8275ebebf1a119969acca92dae226e9e82371
4
+ data.tar.gz: e5cfe0950b4cfe16d3ac2aeb0992601b5a0b43315736b637cae05792b0774bb9
5
5
  SHA512:
6
- metadata.gz: 232ec5b779c018aa9824318e003cd60e3ec3691297903337bb414fff87e757daaacfda2d94fb0c751538dcad194763ad6cb5b072156686bd450d5292d490a2e6
7
- data.tar.gz: b322f5568a1fe5cbc0693a01a7be50d9860e056a9f69325e6c55a9322f2d32f7d1d0889d19e45576ca6f3f9afde9649747d9d02a0e251702f94cd27bf5fae27c
6
+ metadata.gz: c81207ff4dd7893ccc4680b4d6bc1c74b36a59badbfac8c08f02f7ecb6e17f887bc440f40c2dcfe840f219df003c384d0365f54b55340c2ddce771492945b232
7
+ data.tar.gz: bca9c65b22080f4d8e4f8cf162146a7868f520f4f13e34c22e79a95e5ba81f186b914f422afb89918c6d095d896badcd07832a731d8dd0cd152a908a6f7a71ad
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.3.0 (2022-11-25)
6
+
7
+ ### Type checker core
8
+
9
+ * Type check types ([#676](https://github.com/soutaro/steep/pull/676))
10
+
5
11
  ## 1.3.0.pre.2 (2022-11-23)
6
12
 
7
13
  ### Type checker core
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- steep (1.3.0.pre.2)
4
+ steep (1.3.0)
5
5
  activesupport (>= 5.1)
6
6
  csv (>= 3.0.9)
7
7
  fileutils (>= 1.1.0)
@@ -12,7 +12,7 @@ PATH
12
12
  parallel (>= 1.0.0)
13
13
  parser (>= 3.1)
14
14
  rainbow (>= 2.2.2, < 4.0)
15
- rbs (>= 2.8.0.pre)
15
+ rbs (>= 2.8.0)
16
16
  securerandom (>= 0.1)
17
17
  strscan (>= 1.0.0)
18
18
  terminal-table (>= 2, < 4)
@@ -54,7 +54,7 @@ GEM
54
54
  rb-fsevent (0.11.2)
55
55
  rb-inotify (0.10.1)
56
56
  ffi (~> 1.0)
57
- rbs (2.8.0.pre.1)
57
+ rbs (2.8.0)
58
58
  ruby-debug-ide (0.7.3)
59
59
  rake (>= 0.8.1)
60
60
  securerandom (0.2.0)
data/Gemfile.steep CHANGED
@@ -1,4 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'steep', '~> 1.2.0'
4
- gem "rbs", '~> 2.8.0.pre'
3
+ gem 'steep', '~> 1.3.0.pre'
data/Gemfile.steep.lock CHANGED
@@ -27,9 +27,9 @@ GEM
27
27
  rb-fsevent (0.11.2)
28
28
  rb-inotify (0.10.1)
29
29
  ffi (~> 1.0)
30
- rbs (2.8.0.pre.1)
30
+ rbs (2.8.0)
31
31
  securerandom (0.2.0)
32
- steep (1.2.1)
32
+ steep (1.3.0.pre.2)
33
33
  activesupport (>= 5.1)
34
34
  csv (>= 3.0.9)
35
35
  fileutils (>= 1.1.0)
@@ -40,7 +40,7 @@ GEM
40
40
  parallel (>= 1.0.0)
41
41
  parser (>= 3.1)
42
42
  rainbow (>= 2.2.2, < 4.0)
43
- rbs (>= 2.7.0)
43
+ rbs (>= 2.8.0.pre)
44
44
  securerandom (>= 0.1)
45
45
  strscan (>= 1.0.0)
46
46
  terminal-table (>= 2, < 4)
@@ -55,8 +55,7 @@ PLATFORMS
55
55
  arm64-darwin-21
56
56
 
57
57
  DEPENDENCIES
58
- rbs (~> 2.8.0.pre)
59
- steep (~> 1.2.0)
58
+ steep (~> 1.3.0.pre)
60
59
 
61
60
  BUNDLED WITH
62
61
  2.3.15
@@ -27,11 +27,17 @@ module Steep
27
27
  alias eql? ==
28
28
 
29
29
  def subst(s)
30
- s.module_type or raise "Unexpected substitution: #{inspect}"
30
+ if s.module_type
31
+ s.module_type
32
+ else
33
+ self
34
+ end
31
35
  end
32
36
 
33
- def free_variables()
34
- @fvs = Set.new([self])
37
+ @@fvs = Set[instance]
38
+
39
+ def free_variables
40
+ @@fvs
35
41
  end
36
42
 
37
43
  include Helper::NoChild
@@ -204,7 +204,7 @@ module Steep
204
204
  when Logic::Base
205
205
  RBS::Types::Bases::Bool.new(location: type.location)
206
206
  else
207
- raise "Unexpected type given: #{type} (#{type.class})"
207
+ __skip__ = raise "Unexpected type given: #{type} (#{type.class})"
208
208
  end
209
209
  end
210
210
 
@@ -248,7 +248,14 @@ module Steep
248
248
  RBS::AST::TypeParam.new(
249
249
  name: type_param.name,
250
250
  variance: type_param.variance,
251
- upper_bound: type_param.upper_bound&.yield_self {|u| type_1(u) },
251
+ upper_bound: type_param.upper_bound&.yield_self {|u|
252
+ case u_ = type_1(u)
253
+ when RBS::Types::ClassInstance, RBS::Types::ClassSingleton, RBS::Types::Interface
254
+ u_
255
+ else
256
+ raise "`#{u_}` cannot be type parameter upper bound"
257
+ end
258
+ },
252
259
  location: type_param.location
253
260
  ).unchecked!(type_param.unchecked)
254
261
  end
@@ -23,11 +23,16 @@ module Steep
23
23
  alias eql? ==
24
24
 
25
25
  def subst(s)
26
- s.instance_type or raise "Unexpected substitution: #{inspect}"
26
+ if s.instance_type
27
+ s.instance_type
28
+ else
29
+ self
30
+ end
27
31
  end
28
32
 
29
- def free_variables()
30
- @fvs = Set.new([self])
33
+ @@fvs = Set[instance]
34
+ def free_variables
35
+ @@fvs
31
36
  end
32
37
 
33
38
  include Helper::NoChild
@@ -35,7 +35,7 @@ module Steep
35
35
  when 0
36
36
  AST::Types::Top.new(location: location)
37
37
  when 1
38
- tys.first
38
+ tys.first || raise
39
39
  else
40
40
  new(types: dups.to_a, location: location)
41
41
  end
@@ -73,7 +73,11 @@ module Steep
73
73
  include Helper::ChildrenLevel
74
74
 
75
75
  def each_child(&block)
76
- types.each(&block)
76
+ if block
77
+ types.each(&block)
78
+ else
79
+ types.each
80
+ end
77
81
  end
78
82
 
79
83
  def level
@@ -54,7 +54,7 @@ module Steep
54
54
  when false
55
55
  Builtin::FalseClass
56
56
  else
57
- raise "Unexpected literal type: #{value.inspect}"
57
+ raise "Unexpected literal type: #{(_ = value).inspect}"
58
58
  end
59
59
 
60
60
  Name::Instance.new(name: klass.module_name, args: [], location: location)
@@ -9,9 +9,7 @@ module Steep
9
9
  self
10
10
  end
11
11
 
12
- def free_variables
13
- @fvs ||= Set[]
14
- end
12
+ include Helper::NoFreeVariables
15
13
 
16
14
  include Helper::NoChild
17
15
 
@@ -51,14 +51,16 @@ module Steep
51
51
  end
52
52
 
53
53
  def with_location(new_location)
54
- self.class.new(name: name, args: args, location: new_location)
54
+ _ = self.class.new(name: name, args: args, location: new_location)
55
55
  end
56
56
 
57
57
  def subst(s)
58
58
  if free_variables.intersect?(s.domain)
59
- self.class.new(location: location,
60
- name: name,
61
- args: args.map {|a| a.subst(s) })
59
+ _ = self.class.new(
60
+ location: location,
61
+ name: name,
62
+ args: args.map {|a| a.subst(s) }
63
+ )
62
64
  else
63
65
  self
64
66
  end
@@ -73,7 +75,11 @@ module Steep
73
75
  end
74
76
 
75
77
  def each_child(&block)
76
- args.each(&block)
78
+ if block
79
+ args.each(&block)
80
+ else
81
+ args.each
82
+ end
77
83
  end
78
84
 
79
85
  include Helper::ChildrenLevel
@@ -68,10 +68,6 @@ module Steep
68
68
  [0] + level_of_children(children)
69
69
  end
70
70
 
71
- def closed?
72
- type.closed? && (block.nil? || block.closed?) && (self_type ? self_type.closed? : false)
73
- end
74
-
75
71
  def with_location(new_location)
76
72
  self.class.new(location: new_location, block: block, type: type, self_type: self_type)
77
73
  end
@@ -103,7 +99,11 @@ module Steep
103
99
  end
104
100
 
105
101
  def block_required?
106
- block && !block.optional?
102
+ if block
103
+ !block.optional?
104
+ else
105
+ false
106
+ end
107
107
  end
108
108
 
109
109
  def each_child(&block)
@@ -43,7 +43,11 @@ module Steep
43
43
  include Helper::ChildrenLevel
44
44
 
45
45
  def each_child(&block)
46
- elements.each_value(&block)
46
+ if block
47
+ elements.each_value(&block)
48
+ else
49
+ elements.each_value
50
+ end
47
51
  end
48
52
 
49
53
  def level
@@ -29,11 +29,17 @@ module Steep
29
29
  include Helper::NoChild
30
30
 
31
31
  def subst(s)
32
- s.self_type or raise "Unexpected substitution: #{inspect}"
32
+ if s.self_type
33
+ s.self_type
34
+ else
35
+ self
36
+ end
33
37
  end
34
38
 
39
+ @@fvs = Set[instance]
40
+
35
41
  def free_variables
36
- @fvs ||= Set.new([self])
42
+ @@fvs
37
43
  end
38
44
 
39
45
  def level
@@ -31,17 +31,19 @@ module Steep
31
31
  end
32
32
 
33
33
  def free_variables()
34
- @fvs ||= Set.new.tap do |set|
35
- types.each do |type|
36
- set.merge(type.free_variables)
37
- end
34
+ @fvs ||= each_child.with_object(Set[]) do |type, set| #$ Set[variable]
35
+ set.merge(type.free_variables)
38
36
  end
39
37
  end
40
38
 
41
39
  include Helper::ChildrenLevel
42
40
 
43
41
  def each_child(&block)
44
- types.each(&block)
42
+ if block
43
+ types.each(&block)
44
+ else
45
+ types.each
46
+ end
45
47
  end
46
48
 
47
49
  def level
@@ -12,7 +12,9 @@ module Steep
12
12
 
13
13
  def self.build(types:, location: nil)
14
14
  return AST::Types::Bot.new if types.empty?
15
- return types.first if types.size == 1
15
+ if types.size == 1
16
+ return types.first || raise
17
+ end
16
18
 
17
19
  types.flat_map do |type|
18
20
  if type.is_a?(Union)
@@ -36,7 +38,7 @@ module Steep
36
38
  when 0
37
39
  AST::Types::Bot.new
38
40
  when 1
39
- tys.first
41
+ tys.first || raise
40
42
  else
41
43
  new(types: tys, location: location)
42
44
  end
@@ -49,7 +51,7 @@ module Steep
49
51
  end
50
52
 
51
53
  def hash
52
- @hash ||= types.inject(self.class.hash) {|c, type| type.hash ^ c }
54
+ @hash ||= types.inject(self.class.hash) {|c, type| type.hash ^ c } #$ Integer
53
55
  end
54
56
 
55
57
  alias eql? ==
@@ -71,7 +73,11 @@ module Steep
71
73
  end
72
74
 
73
75
  def each_child(&block)
74
- types.each(&block)
76
+ if block
77
+ types.each(&block)
78
+ else
79
+ types.each
80
+ end
75
81
  end
76
82
 
77
83
  include Helper::ChildrenLevel
@@ -22,7 +22,7 @@ module Steep
22
22
  alias eql? ==
23
23
 
24
24
  def self.fresh_name(name)
25
- @mutex ||= Mutex.new
25
+ @mutex ||= Thread::Mutex.new
26
26
 
27
27
  @mutex.synchronize do
28
28
  @max ||= 0
@@ -6,7 +6,7 @@ module Steep
6
6
  attr_reader :types_size
7
7
 
8
8
  def initialize(vars_size:, types_size:)
9
- @var_size = vars_size
9
+ @vars_size = vars_size
10
10
  @types_size = types_size
11
11
 
12
12
  super "Invalid substitution: vars.size=#{vars_size}, types.size=#{types_size}"
@@ -43,15 +43,15 @@ module Steep
43
43
  set = Set.new
44
44
 
45
45
  set.merge(dictionary.keys)
46
- set << AST::Types::Instance.instance unless instance_type.is_a?(AST::Types::Instance)
47
- set << AST::Types::Class.instance unless instance_type.is_a?(AST::Types::Class)
48
- set << AST::Types::Instance.instance unless instance_type.is_a?(AST::Types::Self)
46
+ set << AST::Types::Self.instance if self_type
47
+ set << AST::Types::Class.instance if module_type
48
+ set << AST::Types::Instance.instance if instance_type
49
49
 
50
50
  set
51
51
  end
52
52
 
53
53
  def to_s
54
- a = []
54
+ a = [] #: Array[String]
55
55
 
56
56
  dictionary.each do |x, ty|
57
57
  a << "#{x} -> #{ty}"
@@ -87,12 +87,13 @@ module Steep
87
87
  end
88
88
  end
89
89
 
90
- def self.build(vars, types = nil, instance_type: AST::Types::Instance.instance, module_type: AST::Types::Class.instance, self_type: AST::Types::Self.instance)
90
+ def self.build(vars, types = nil, instance_type: nil, module_type: nil, self_type: nil)
91
91
  types ||= vars.map {|var| AST::Types::Var.fresh(var) }
92
92
 
93
93
  raise InvalidSubstitutionError.new(vars_size: vars.size, types_size: types.size) unless vars.size == types.size
94
94
 
95
- dic = vars.zip(types).each.with_object({}) do |(var, type), d|
95
+ dic = vars.zip(types).each.with_object({}) do |(var, type), d| #$ Hash[Symbol, AST::Types::t]
96
+ type or raise
96
97
  d[var] = type
97
98
  end
98
99
 
@@ -130,9 +131,9 @@ module Steep
130
131
  end
131
132
  end
132
133
 
133
- @instance_type = instance_type.subst(s)
134
- @module_type = module_type.subst(s)
135
- @self_type = self_type.subst(s)
134
+ @instance_type = instance_type.subst(s) if instance_type
135
+ @module_type = module_type.subst(s) if module_type
136
+ @self_type = self_type.subst(s) if self_type
136
137
 
137
138
  self
138
139
  end
@@ -270,9 +270,9 @@ module Steep
270
270
  mixin_constraints(definition, ancestors.included_modules || raise, immediate_self_types: ancestors.self_types).each do |relation, ancestor|
271
271
  checker.check(
272
272
  relation,
273
- self_type: AST::Types::Self.new,
274
- instance_type: AST::Types::Instance.new,
275
- class_type: AST::Types::Class.new,
273
+ self_type: AST::Types::Self.instance,
274
+ instance_type: AST::Types::Instance.instance,
275
+ class_type: AST::Types::Class.instance,
276
276
  constraints: Subtyping::Constraints.empty
277
277
  ).else do
278
278
  raise if ancestor.source.is_a?(Symbol)
@@ -314,16 +314,16 @@ module Steep
314
314
  relation = Subtyping::Relation.new(sub_type: var_type, super_type: parent_type)
315
315
  result1 = checker.check(
316
316
  relation,
317
- self_type: AST::Types::Self.new,
318
- instance_type: AST::Types::Instance.new,
319
- class_type: AST::Types::Class.new,
317
+ self_type: AST::Types::Self.instance,
318
+ instance_type: AST::Types::Instance.instance,
319
+ class_type: AST::Types::Class.instance,
320
320
  constraints: Subtyping::Constraints.empty
321
321
  )
322
322
  result2 = checker.check(
323
323
  relation.flip,
324
- self_type: AST::Types::Self.new,
325
- instance_type: AST::Types::Instance.new,
326
- class_type: AST::Types::Class.new,
324
+ self_type: AST::Types::Self.instance,
325
+ instance_type: AST::Types::Instance.instance,
326
+ class_type: AST::Types::Class.instance,
327
327
  constraints: Subtyping::Constraints.empty
328
328
  )
329
329
 
@@ -362,13 +362,13 @@ module Steep
362
362
  mixin_constraints(definition, ancestors.extended_modules, immediate_self_types: ancestors.self_types).each do |relation, ancestor|
363
363
  checker.check(
364
364
  relation,
365
- self_type: AST::Types::Self.new,
366
- instance_type: AST::Types::Instance.new,
367
- class_type: AST::Types::Class.new,
365
+ self_type: AST::Types::Self.instance ,
366
+ instance_type: AST::Types::Instance.instance,
367
+ class_type: AST::Types::Class.instance,
368
368
  constraints: Subtyping::Constraints.empty
369
369
  ).else do
370
370
  raise if ancestor.source.is_a?(Symbol)
371
-
371
+
372
372
  @errors << Diagnostic::Signature::ModuleSelfTypeError.new(
373
373
  name: name,
374
374
  location: ancestor.source&.location || raise,
@@ -390,14 +390,14 @@ module Steep
390
390
  # 4. none of the above (example: T = String, K = Integer)
391
391
 
392
392
  relation = Subtyping::Relation.new(sub_type: type, super_type: instance_type)
393
- if subtyping.check(relation, constraints: Subtyping::Constraints.empty, self_type: AST::Types::Self.new, instance_type: AST::Types::Instance.new, class_type: AST::Types::Class.new).success?
393
+ if subtyping.check(relation, constraints: Subtyping::Constraints.empty, self_type: AST::Types::Self.instance, instance_type: AST::Types::Instance.instance, class_type: AST::Types::Class.instance).success?
394
394
  # 1 or 2. Satisfies the condition, no narrowing because `type` is already more specific than/equals to `instance_type`
395
395
  [
396
396
  [type],
397
397
  []
398
398
  ]
399
399
  else
400
- if subtyping.check(relation.flip, constraints: Subtyping::Constraints.empty, self_type: AST::Types::Self.new, instance_type: AST::Types::Instance.new, class_type: AST::Types::Class.new).success?
400
+ if subtyping.check(relation.flip, constraints: Subtyping::Constraints.empty, self_type: AST::Types::Self.instance, instance_type: AST::Types::Instance.instance, class_type: AST::Types::Class.instance).success?
401
401
  # 3. Satisfied the condition, narrows to `instance_type`, but cannot remove it from *falsy* list
402
402
  [
403
403
  [instance_type],
data/lib/steep/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "1.3.0.pre.2"
2
+ VERSION = "1.3.0"
3
3
  end
data/lib/steep.rb CHANGED
@@ -93,7 +93,6 @@ require "steep/type_inference/type_env_builder"
93
93
  require "steep/type_inference/logic_type_interpreter"
94
94
  require "steep/type_inference/multiple_assignment"
95
95
  require "steep/type_inference/method_call"
96
- require "steep/ast/types"
97
96
 
98
97
  require "steep/index/rbs_index"
99
98
  require "steep/index/signature_symbol_provider"
@@ -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
@@ -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