steep 1.7.0.dev.2 → 1.7.0.dev.3

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +10 -12
  3. data/gemfile_steep/Gemfile.lock +8 -10
  4. data/lib/steep/ast/types/helper.rb +4 -0
  5. data/lib/steep/ast/types/intersection.rb +7 -0
  6. data/lib/steep/ast/types/record.rb +7 -0
  7. data/lib/steep/ast/types/tuple.rb +7 -0
  8. data/lib/steep/ast/types/union.rb +7 -0
  9. data/lib/steep/drivers/stats.rb +2 -2
  10. data/lib/steep/drivers/validate.rb +4 -2
  11. data/lib/steep/expectations.rb +2 -2
  12. data/lib/steep/interface/builder.rb +336 -360
  13. data/lib/steep/interface/function.rb +69 -6
  14. data/lib/steep/interface/method_type.rb +3 -3
  15. data/lib/steep/interface/shape.rb +69 -18
  16. data/lib/steep/interface/substitution.rb +4 -0
  17. data/lib/steep/node_helper.rb +18 -1
  18. data/lib/steep/services/completion_provider.rb +19 -17
  19. data/lib/steep/services/signature_help_provider.rb +6 -9
  20. data/lib/steep/subtyping/check.rb +4 -16
  21. data/lib/steep/test.rb +9 -0
  22. data/lib/steep/type_construction.rb +13 -9
  23. data/lib/steep/type_inference/block_params.rb +11 -3
  24. data/lib/steep/type_inference/context.rb +1 -1
  25. data/lib/steep/type_inference/logic_type_interpreter.rb +1 -1
  26. data/lib/steep/version.rb +1 -1
  27. data/lib/steep.rb +11 -7
  28. data/sig/steep/ast/types/helper.rbs +2 -0
  29. data/sig/steep/ast/types/intersection.rbs +2 -0
  30. data/sig/steep/ast/types/name.rbs +4 -0
  31. data/sig/steep/ast/types/record.rbs +2 -0
  32. data/sig/steep/ast/types/tuple.rbs +2 -0
  33. data/sig/steep/ast/types/union.rbs +2 -0
  34. data/sig/steep/expectations.rbs +1 -1
  35. data/sig/steep/interface/block.rbs +2 -2
  36. data/sig/steep/interface/builder.rbs +94 -108
  37. data/sig/steep/interface/function.rbs +34 -29
  38. data/sig/steep/interface/shape.rbs +23 -4
  39. data/sig/steep/interface/substitution.rbs +2 -0
  40. data/sig/steep/node_helper.rbs +11 -0
  41. data/sig/steep/services/signature_help_provider.rbs +2 -0
  42. data/sig/steep/subtyping/constraints.rbs +2 -2
  43. data/sig/steep/type_construction.rbs +1 -1
  44. data/sig/steep/type_inference/block_params.rbs +2 -2
  45. data/sig/steep/type_inference/context.rbs +2 -0
  46. data/sig/steep.rbs +1 -1
  47. metadata +3 -2
@@ -66,6 +66,17 @@ module Steep
66
66
 
67
67
  def test_send_node: (Node) { (Node?, Symbol, Array[Node], send_loc) -> bool } -> bool
68
68
 
69
+ # Returns if given node allows calling private method
70
+ #
71
+ # The node must be:
72
+ #
73
+ # * A `send` node,
74
+ # * A `csend` node,
75
+ # * A `block` node, or
76
+ # * A `nblock` node
77
+ #
78
+ def private_send?: (Node) -> bool
79
+
69
80
  # Deconstruct sendish node and it's associated block node
70
81
  #
71
82
  # Receives a sequence of node tree where the leaf node comes first.
@@ -17,6 +17,8 @@ module Steep
17
17
  def parameters: () -> Array[String]
18
18
  end
19
19
 
20
+ include Steep::NodeHelper
21
+
20
22
  attr_reader source: Source
21
23
 
22
24
  attr_reader path: Pathname
@@ -91,8 +91,8 @@ module Steep
91
91
 
92
92
  def lower_bound: (Symbol var, ?skip: bool) -> AST::Types::t
93
93
 
94
- def solution: (Check checker, variables: Enumerable[Symbol], variance: VariableVariance, self_type: AST::Types::t, instance_type: AST::Types::t, class_type: AST::Types::t) -> Interface::Substitution
95
- | (Check checker, variables: Enumerable[Symbol], context: Context) -> Interface::Substitution
94
+ def solution: (Check checker, variables: Enumerable[AST::Types::variable], variance: VariableVariance, self_type: AST::Types::t, instance_type: AST::Types::t, class_type: AST::Types::t) -> Interface::Substitution
95
+ | (Check checker, variables: Enumerable[AST::Types::variable], context: Context) -> Interface::Substitution
96
96
 
97
97
  def has_constraint?: (Symbol var) -> bool
98
98
 
@@ -325,7 +325,7 @@ module Steep
325
325
  def set_up_block_mlhs_params_env: (
326
326
  Parser::AST::Node mlhs_node,
327
327
  AST::Types::t type,
328
- Hash[Symbol, AST::Types::t]
328
+ Hash[Symbol?, AST::Types::t]
329
329
  ) { (Parser::AST::Node error_mlhs_node, AST::Types::t type) -> void } -> void
330
330
 
331
331
  # Returns a Pair of
@@ -37,7 +37,7 @@ module Steep
37
37
  # * `node` is the node of the parameter
38
38
  #
39
39
  class Param
40
- attr_reader var: Symbol
40
+ attr_reader var: Symbol?
41
41
 
42
42
  attr_reader type: AST::Types::t?
43
43
 
@@ -45,7 +45,7 @@ module Steep
45
45
 
46
46
  attr_reader node: Parser::AST::Node
47
47
 
48
- def initialize: (var: Symbol, type: AST::Types::t?, value: Parser::AST::Node?, node: Parser::AST::Node) -> void
48
+ def initialize: (var: Symbol?, type: AST::Types::t?, value: Parser::AST::Node?, node: Parser::AST::Node) -> void
49
49
 
50
50
  def ==: (untyped other) -> bool
51
51
 
@@ -147,6 +147,8 @@ module Steep
147
147
  # Returns the upper bound of a type variable
148
148
  def []: (Symbol name) -> AST::Types::t?
149
149
 
150
+ @upper_bounds: Hash[Symbol, AST::Types::t]?
151
+
150
152
  def upper_bounds: () -> Hash[Symbol, AST::Types::t]
151
153
 
152
154
  def self.empty: () -> TypeVariableContext
data/sig/steep.rbs CHANGED
@@ -14,7 +14,7 @@ module Steep
14
14
 
15
15
  attr_accessor self.log_output: IO
16
16
 
17
- def self.measure: [A] (String message, ?level: ::Symbol) { () -> A } -> A
17
+ def self.measure: [A] (String message, ?level: ::Symbol, ?threshold: Float) { () -> A } -> A
18
18
 
19
19
  def self.log_error: (Exception exn, ?message: ::String) -> void
20
20
 
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.7.0.dev.2
4
+ version: 1.7.0.dev.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-22 00:00:00.000000000 Z
11
+ date: 2024-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -362,6 +362,7 @@ files:
362
362
  - lib/steep/subtyping/relation.rb
363
363
  - lib/steep/subtyping/result.rb
364
364
  - lib/steep/subtyping/variable_variance.rb
365
+ - lib/steep/test.rb
365
366
  - lib/steep/thread_waiter.rb
366
367
  - lib/steep/type_construction.rb
367
368
  - lib/steep/type_inference/block_params.rb