steep 1.3.0.pre.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile.lock +3 -3
  4. data/Gemfile.steep +1 -2
  5. data/Gemfile.steep.lock +4 -5
  6. data/bin/steep-prof +1 -1
  7. data/lib/steep/ast/types/class.rb +9 -3
  8. data/lib/steep/ast/types/factory.rb +9 -2
  9. data/lib/steep/ast/types/helper.rb +4 -3
  10. data/lib/steep/ast/types/instance.rb +8 -3
  11. data/lib/steep/ast/types/intersection.rb +6 -2
  12. data/lib/steep/ast/types/literal.rb +1 -1
  13. data/lib/steep/ast/types/logic.rb +5 -3
  14. data/lib/steep/ast/types/name.rb +11 -5
  15. data/lib/steep/ast/types/proc.rb +5 -5
  16. data/lib/steep/ast/types/record.rb +5 -1
  17. data/lib/steep/ast/types/self.rb +8 -2
  18. data/lib/steep/ast/types/tuple.rb +7 -5
  19. data/lib/steep/ast/types/union.rb +10 -4
  20. data/lib/steep/ast/types/var.rb +1 -1
  21. data/lib/steep/drivers/check.rb +1 -1
  22. data/lib/steep/drivers/checkfile.rb +1 -1
  23. data/lib/steep/drivers/langserver.rb +2 -2
  24. data/lib/steep/drivers/stats.rb +1 -1
  25. data/lib/steep/drivers/utils/jobs_option.rb +0 -4
  26. data/lib/steep/drivers/watch.rb +1 -1
  27. data/lib/steep/interface/substitution.rb +11 -10
  28. data/lib/steep/server/worker_process.rb +16 -11
  29. data/lib/steep/services/completion_provider.rb +2 -1
  30. data/lib/steep/services/goto_service.rb +2 -1
  31. data/lib/steep/services/hover_provider/ruby.rb +2 -1
  32. data/lib/steep/services/signature_service.rb +16 -0
  33. data/lib/steep/services/type_check_service.rb +4 -4
  34. data/lib/steep/signature/validator.rb +13 -13
  35. data/lib/steep/type_construction.rb +25 -20
  36. data/lib/steep/type_inference/logic_type_interpreter.rb +2 -2
  37. data/lib/steep/version.rb +1 -1
  38. data/lib/steep.rb +0 -1
  39. data/rbs_collection.steep.lock.yaml +1 -1
  40. data/sig/steep/ast/builtin.rbs +1 -1
  41. data/sig/steep/ast/types/any.rbs +6 -6
  42. data/sig/steep/ast/types/boolean.rbs +7 -7
  43. data/sig/steep/ast/types/bot.rbs +6 -6
  44. data/sig/steep/ast/types/class.rbs +8 -7
  45. data/sig/steep/ast/types/helper.rbs +6 -3
  46. data/sig/steep/ast/types/instance.rbs +7 -6
  47. data/sig/steep/ast/types/intersection.rbs +13 -10
  48. data/sig/steep/ast/types/literal.rbs +6 -4
  49. data/sig/steep/ast/types/logic.rbs +9 -9
  50. data/sig/steep/ast/types/name.rbs +9 -5
  51. data/sig/steep/ast/types/nil.rbs +7 -7
  52. data/sig/steep/ast/types/proc.rbs +8 -3
  53. data/sig/steep/ast/types/record.rbs +8 -9
  54. data/sig/steep/ast/types/self.rbs +8 -7
  55. data/sig/steep/ast/types/top.rbs +6 -6
  56. data/sig/steep/ast/types/tuple.rbs +6 -5
  57. data/sig/steep/ast/types/union.rbs +9 -9
  58. data/sig/steep/ast/types/var.rbs +16 -11
  59. data/sig/steep/ast/types/void.rbs +6 -6
  60. data/sig/steep/ast/types.rbs +5 -26
  61. data/sig/steep/drivers/utils/jobs_option.rbs +0 -2
  62. data/sig/steep/interface/substitution.rbs +9 -9
  63. data/sig/steep/server/worker_process.rbs +2 -2
  64. data/sig/steep/services/signature_service.rbs +14 -0
  65. data/sig/steep/services/type_check_service.rbs +2 -2
  66. data/sig/steep.rbs +2 -0
  67. data/steep.gemspec +1 -1
  68. metadata +6 -7
  69. data/lib/steep/ast/types.rb +0 -62
@@ -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,20 +16,21 @@ 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
 
29
28
  def each_child: () { (t) -> void } -> void
30
29
  | () -> Enumerator[t, void]
31
30
 
32
- def level: () -> Integer
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
- def level: () -> ::Array[0]
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
- def level: () -> ::Array[2]
23
+ def level: () -> Array[Integer]
24
24
 
25
- def with_location: (untyped new_location) -> untyped
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,16 +18,17 @@ 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
 
25
26
  def each_child: () { (t) -> void } -> void
26
27
  | () -> Enumerator[t, void]
27
28
 
28
- def level: () -> untyped
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,34 +4,34 @@ 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]
29
29
 
30
30
  include Helper::ChildrenLevel
31
31
 
32
- def level: () -> Integer
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
- def level: () -> ::Array[0]
34
+ def level: () -> Array[Integer]
30
35
 
31
- def update: (?name: untyped, ?location: untyped) -> untyped
36
+ def update: (?name: Symbol, ?location: untyped) -> Var
32
37
 
33
- def with_location: (untyped new_location) -> untyped
38
+ def with_location: (untyped new_location) -> Var
34
39
  end
35
40
  end
36
41
  end
@@ -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) -> Void
16
16
 
17
- def to_s: () -> "void"
17
+ def to_s: () -> String
18
18
 
19
19
  include Helper::NoFreeVariables
20
20
 
21
21
  include Helper::NoChild
22
22
 
23
- def level: () -> ::Array[0]
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
@@ -15,8 +15,6 @@ module Steep
15
15
  def default_jobs_count: () -> Integer
16
16
 
17
17
  def jobs_count_value: () -> Integer
18
-
19
- def steep_command_value: () -> String
20
18
  end
21
19
  end
22
20
  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
 
@@ -48,7 +48,7 @@ module Steep
48
48
  worker_type `type`,
49
49
  name: String,
50
50
  steepfile: Pathname,
51
- ?steep_command: ::String,
51
+ steep_command: String?,
52
52
  ?patterns: Array[String],
53
53
  ?delay_shutdown: bool,
54
54
  ?index: [Integer, Integer]?
@@ -76,7 +76,7 @@ module Steep
76
76
  def self.start_typecheck_workers: (
77
77
  steepfile: Pathname,
78
78
  args: Array[String],
79
- ?steep_command: ::String,
79
+ steep_command: ::String?,
80
80
  ?count: Integer,
81
81
  ?delay_shutdown: bool
82
82
  ) -> Array[WorkerProcess]
@@ -16,9 +16,13 @@ module Steep
16
16
 
17
17
  @rbs_index: Index::RBSIndex?
18
18
 
19
+ @constant_resolver: RBS::Resolver::ConstantResolver?
20
+
19
21
  def initialize: (files: Hash[Pathname, FileStatus], changed_paths: Set[Pathname], diagnostics: Array[Diagnostic::Signature::Base], last_builder: RBS::DefinitionBuilder) -> void
20
22
 
21
23
  def rbs_index: () -> Index::RBSIndex
24
+
25
+ def constant_resolver: () -> RBS::Resolver::ConstantResolver
22
26
  end
23
27
 
24
28
  class AncestorErrorStatus
@@ -32,9 +36,13 @@ module Steep
32
36
 
33
37
  @rbs_index: Index::RBSIndex?
34
38
 
39
+ @constant_resolver: RBS::Resolver::ConstantResolver?
40
+
35
41
  def initialize: (files: Hash[Pathname, FileStatus], changed_paths: Set[Pathname], diagnostics: Array[Diagnostic::Signature::Base], last_builder: RBS::DefinitionBuilder) -> void
36
42
 
37
43
  def rbs_index: () -> Index::RBSIndex
44
+
45
+ def constant_resolver: () -> RBS::Resolver::ConstantResolver
38
46
  end
39
47
 
40
48
  class LoadedStatus
@@ -46,11 +54,15 @@ module Steep
46
54
 
47
55
  @subtyping: Subtyping::Check?
48
56
 
57
+ @constant_resolver: RBS::Resolver::ConstantResolver?
58
+
49
59
  def initialize: (files: Hash[Pathname, FileStatus], builder: RBS::DefinitionBuilder) -> void
50
60
 
51
61
  def subtyping: () -> Subtyping::Check
52
62
 
53
63
  def rbs_index: () -> Index::RBSIndex
64
+
65
+ def constant_resolver: () -> RBS::Resolver::ConstantResolver
54
66
  end
55
67
 
56
68
  class FileStatus
@@ -88,6 +100,8 @@ module Steep
88
100
 
89
101
  def latest_rbs_index: () -> Index::RBSIndex
90
102
 
103
+ def latest_constant_resolver: () -> RBS::Resolver::ConstantResolver
104
+
91
105
  def current_subtyping: () -> Subtyping::Check?
92
106
 
93
107
  def apply_changes: (Hash[Pathname, FileStatus] files, Server::ChangeBuffer::changes changes) -> Hash[Pathname, FileStatus]
@@ -91,9 +91,9 @@ module Steep
91
91
 
92
92
  def update_sources: (changes: Server::ChangeBuffer::changes, requests: Hash[Project::Target, TargetRequest]) -> void
93
93
 
94
- def type_check_file: (target: Project::Target, subtyping: Subtyping::Check, path: Pathname, text: String) -> SourceFile
94
+ def type_check_file: (target: Project::Target, subtyping: Subtyping::Check, path: Pathname, text: String) { () -> RBS::Resolver::ConstantResolver } -> SourceFile
95
95
 
96
- def self.type_check: (source: Source, subtyping: Subtyping::Check) -> Typing
96
+ def self.type_check: (source: Source, subtyping: Subtyping::Check, constant_resolver: RBS::Resolver::ConstantResolver) -> Typing
97
97
 
98
98
  def source_file?: (Pathname path) -> Project::Target?
99
99
 
data/sig/steep.rbs CHANGED
@@ -1,4 +1,6 @@
1
1
  module Steep
2
+ VERSION: String
3
+
2
4
  def self.logger: () -> (Logger & ActiveSupport::TaggedLogging)
3
5
 
4
6
  def self.new_logger: (untyped output, untyped prev_level) -> untyped
data/steep.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
34
34
  spec.add_runtime_dependency "listen", "~> 3.0"
35
35
  spec.add_runtime_dependency "language_server-protocol", ">= 3.15", "< 4.0"
36
- spec.add_runtime_dependency "rbs", ">= 2.8.0.pre"
36
+ spec.add_runtime_dependency "rbs", ">= 2.8.0"
37
37
  spec.add_runtime_dependency "parallel", ">= 1.0.0"
38
38
  spec.add_runtime_dependency "terminal-table", ">= 2", "< 4"
39
39
  spec.add_runtime_dependency "securerandom", ">= 0.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0.pre.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-22 00:00:00.000000000 Z
11
+ date: 2022-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -98,14 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: 2.8.0.pre
101
+ version: 2.8.0
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
- version: 2.8.0.pre
108
+ version: 2.8.0
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: parallel
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -261,7 +261,6 @@ files:
261
261
  - lib/steep/ast/node/type_application.rb
262
262
  - lib/steep/ast/node/type_assertion.rb
263
263
  - lib/steep/ast/type_params.rb
264
- - lib/steep/ast/types.rb
265
264
  - lib/steep/ast/types/any.rb
266
265
  - lib/steep/ast/types/boolean.rb
267
266
  - lib/steep/ast/types/bot.rb
@@ -764,9 +763,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
764
763
  version: 2.6.0
765
764
  required_rubygems_version: !ruby/object:Gem::Requirement
766
765
  requirements:
767
- - - ">"
766
+ - - ">="
768
767
  - !ruby/object:Gem::Version
769
- version: 1.3.1
768
+ version: '0'
770
769
  requirements: []
771
770
  rubygems_version: 3.3.7
772
771
  signing_key:
@@ -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