steep 0.52.1 → 0.52.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +2 -2
- data/lib/steep/shims/filter_map.rb +30 -0
- data/lib/steep/type_construction.rb +17 -7
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c9d5eb873780b31a2431d2e6c4efdc558fbb3a4a42c08cbe2580bb191db5bc8
|
4
|
+
data.tar.gz: dee794e9cb098309b9875396ed1dc9904a4c6882aeadb27c83c26604ebcbc87d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba05f88c28a78414ffcd41744558bdea978b72621f422571cb1450b7b0d56fb77c2b65329064226863db2517d4769a6f54e7c47ce92eef59d97f0403bb9e9425
|
7
|
+
data.tar.gz: 6e260b48940214b7c0910bf2678c587b469e163e70265f197ef8fd17a1703a68fd9488c77c3d1f8254939c074281717593e49812875fb705615189cd3ec4cdf0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.52.2 (2022-05-02)
|
6
|
+
|
7
|
+
* Handle class declaration with non-const super class ([\#546](https://github.com/soutaro/steep/pull/546))
|
8
|
+
* Remove `#to_a` error message ([\#545](https://github.com/soutaro/steep/pull/545))
|
9
|
+
* Add `#filter_map` shim ([\#544](https://github.com/soutaro/steep/pull/544))
|
10
|
+
|
5
11
|
## 0.52.1 (2022-04-25)
|
6
12
|
|
7
13
|
* Better union type inference (it type checks `Array#filter_map` now!) ([\#531](https://github.com/soutaro/steep/pull/531))
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
steep (0.52.
|
4
|
+
steep (0.52.2)
|
5
5
|
activesupport (>= 5.1)
|
6
6
|
language_server-protocol (>= 3.15, < 4.0)
|
7
7
|
listen (~> 3.0)
|
@@ -24,7 +24,7 @@ PATH
|
|
24
24
|
GEM
|
25
25
|
remote: https://rubygems.org/
|
26
26
|
specs:
|
27
|
-
activesupport (7.0.2.
|
27
|
+
activesupport (7.0.2.4)
|
28
28
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
29
29
|
i18n (>= 1.6, < 2)
|
30
30
|
minitest (>= 5.1)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Steep runs on Ruby 2.6 and it needs a shim of `filter_map`
|
2
|
+
|
3
|
+
module Shims
|
4
|
+
module EnumerableFilterMap
|
5
|
+
def filter_map(&block)
|
6
|
+
if block
|
7
|
+
result = []
|
8
|
+
|
9
|
+
each do |element|
|
10
|
+
if value = yield(element)
|
11
|
+
result << value
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
result
|
16
|
+
else
|
17
|
+
enum_for :filter_map
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
unless Enumerable.method_defined?(:filter_map)
|
23
|
+
Enumerable.include EnumerableFilterMap
|
24
|
+
|
25
|
+
module ::Enumerable
|
26
|
+
alias filter_map filter_map
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -1498,13 +1498,18 @@ module Steep
|
|
1498
1498
|
end
|
1499
1499
|
|
1500
1500
|
if super_node
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1501
|
+
if super_node.type == :const
|
1502
|
+
_, constr, super_name = constr.synthesize_constant(super_node, super_node.children[0], super_node.children[1]) do
|
1503
|
+
typing.add_error(
|
1504
|
+
Diagnostic::Ruby::UnknownConstant.new(node: super_node, name: super_node.children[1]).class!
|
1505
|
+
)
|
1506
|
+
end
|
1507
|
+
|
1508
|
+
if super_name
|
1509
|
+
typing.source_index.add_reference(constant: super_name, ref: super_node)
|
1510
|
+
end
|
1511
|
+
else
|
1512
|
+
_, constr = synthesize(super_node, hint: nil, condition: false)
|
1508
1513
|
end
|
1509
1514
|
end
|
1510
1515
|
|
@@ -3981,6 +3986,11 @@ module Steep
|
|
3981
3986
|
end
|
3982
3987
|
|
3983
3988
|
def try_convert(type, method)
|
3989
|
+
case type
|
3990
|
+
when AST::Types::Any, AST::Types::Bot, AST::Types::Top, AST::Types::Var
|
3991
|
+
return
|
3992
|
+
end
|
3993
|
+
|
3984
3994
|
interface = checker.factory.interface(type, private: false)
|
3985
3995
|
if entry = interface.methods[method]
|
3986
3996
|
method_type = entry.method_types.find do |method_type|
|
data/lib/steep/version.rb
CHANGED
data/lib/steep.rb
CHANGED
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.52.
|
4
|
+
version: 0.52.2
|
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
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -248,6 +248,7 @@ files:
|
|
248
248
|
- lib/steep/services/signature_service.rb
|
249
249
|
- lib/steep/services/stats_calculator.rb
|
250
250
|
- lib/steep/services/type_check_service.rb
|
251
|
+
- lib/steep/shims/filter_map.rb
|
251
252
|
- lib/steep/signature/validator.rb
|
252
253
|
- lib/steep/source.rb
|
253
254
|
- lib/steep/subtyping/cache.rb
|