steep 0.17.0 → 0.21.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.
@@ -31,8 +31,8 @@ module Steep
31
31
  annotations.const_types.each do |name, type|
32
32
  env.set(const: name, type: type)
33
33
  end
34
- signatures.name_to_global.each do |name, global|
35
- type = signatures.absolute_type(global.type, namespace: RBS::Namespace.root) {|ty| ty.name.absolute! }
34
+ signatures.global_decls.each do |name, entry|
35
+ type = entry.decl.type
36
36
  env.set(gvar: name, type: subtyping.factory.type(type))
37
37
  end
38
38
  end
@@ -95,6 +95,12 @@ module Steep
95
95
  end_pos = node.loc.end.begin_pos
96
96
  add_context(begin_pos..end_pos, context: context)
97
97
 
98
+ when :sclass
99
+ name_node = node.children[0]
100
+ begin_pos = name_node.loc.expression.end_pos
101
+ end_pos = node.loc.end.begin_pos
102
+ add_context(begin_pos..end_pos, context: context)
103
+
98
104
  when :def, :defs
99
105
  args_node = case node.type
100
106
  when :def
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "0.17.0"
2
+ VERSION = "0.21.0"
3
3
  end
@@ -18,7 +18,6 @@ class D
18
18
  def foo: -> untyped
19
19
  end
20
20
 
21
- class E
22
- def initialize: () -> untyped
21
+ interface _E
23
22
  def foo: -> untyped
24
23
  end
@@ -1,8 +1,10 @@
1
- # @type var e: E
1
+ # @type var e: _E
2
2
  # @type var d: D
3
3
 
4
4
  e = (_ = nil)
5
5
  d = (_ = nil)
6
6
 
7
7
  e = d
8
+
9
+ # !expects IncompatibleAssignment: lhs_type=::D, rhs_type=::_E
8
10
  d = e
@@ -1,9 +1,10 @@
1
- extension Object (X)
1
+
2
+ class Object
2
3
  def try: [A] { (instance) -> A } -> A
3
4
  def f: -> Object
4
5
  end
5
6
 
6
- extension Kernel (X)
7
+ module Kernel
7
8
  def new_module_method: () -> void
8
9
  end
9
10
 
@@ -2,7 +2,6 @@ class NumberLike
2
2
  def to_number: -> Integer
3
3
  end
4
4
 
5
- extension Integer (NumberLike)
6
- def `+`: (NumberLike) -> NumberLike
7
- | super
5
+ class Integer
6
+ overload def `+`: (NumberLike) -> NumberLike
8
7
  end
@@ -1,12 +1,12 @@
1
1
  class A
2
2
  def foo: -> _Foo
3
3
  def hello: -> void
4
- end
5
4
 
6
- class A::Object
7
- def object?: -> bool
8
- end
5
+ class Object
6
+ def object?: -> bool
7
+ end
9
8
 
10
- interface A::_Foo
11
- def foo: -> Object
9
+ interface _Foo
10
+ def foo: -> Object
11
+ end
12
12
  end
@@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
41
41
  spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
42
42
  spec.add_runtime_dependency "listen", "~> 3.1"
43
43
  spec.add_runtime_dependency "language_server-protocol", "~> 3.14.0.2"
44
- spec.add_runtime_dependency "rbs", "~> 0.3.1"
44
+ spec.add_runtime_dependency "rbs", "~> 0.7.0"
45
45
  end
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: 0.17.0
4
+ version: 0.21.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: 2020-06-13 00:00:00.000000000 Z
11
+ date: 2020-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: 0.3.1
193
+ version: 0.7.0
194
194
  type: :runtime
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: 0.3.1
200
+ version: 0.7.0
201
201
  description: Gradual Typing for Ruby
202
202
  email:
203
203
  - matsumoto@soutaro.com