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
@@ -1,62 +0,0 @@
1
- module Steep
2
- module AST
3
- module Types
4
- class Masked
5
- attr_reader :location
6
- attr_reader :type
7
- attr_reader :mask
8
-
9
- def initialize(type:, mask:, location:)
10
- @type = type
11
- @mask = mask
12
- @location = location
13
- end
14
-
15
- def ==(other)
16
- other.is_a?(Masked) &&
17
- other.type == type &&
18
- other.mask == mask
19
- end
20
-
21
- alias eql? ==
22
-
23
- def hash
24
- self.class.hash ^ type.hash ^ mask.hash
25
- end
26
-
27
- def to_json(*a)
28
- { class: :masked,
29
- type: type,
30
- mask: mask,
31
- location: location }.to_json(*a)
32
- end
33
-
34
- def to_s(level = 0)
35
- "masked(#{type}|#{mask})"
36
- end
37
-
38
- def free_variables
39
- @fvs ||= Set.new.tap do |set|
40
- set.merge(type.free_variables)
41
- set.merge(mask.free_variables)
42
- end
43
- end
44
-
45
- def each_type(&block)
46
- if block_given?
47
- yield type
48
- yield mask
49
- else
50
- enum_for :each_type
51
- end
52
- end
53
-
54
- def sub(s)
55
- self.class.new(type: type.sub(s),
56
- mask: mask.sub(s),
57
- location: location)
58
- end
59
- end
60
- end
61
- end
62
- end