rbs 2.2.0 → 2.2.1
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/lib/rbs/type_alias_regularity.rb +6 -4
- data/lib/rbs/validator.rb +4 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/validator.rbs +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148d69843b5a84c07daea0f8729c7f72c693daf327ef82045cb312c2211c09fe
|
4
|
+
data.tar.gz: 4df8267989d27a0b9d807e5149681ba854e73976e3e9e8ea610f480d89ac261d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7ed92c4b514890fbe54072a32e3f114cc5f403167b14cbaf6ac3809abff21af854ab004f6752731e169040e536be364e56ef3d5063c6695b98a6b8b8b78d3ed
|
7
|
+
data.tar.gz: 0704c9b4623410f6f83563c04d2497c0f35b3cf1bc68ae1e146d48f7ca8994848f3d58d34bcb70178efeee3bc0283b519d4aa0f664e812e879711bc830678802
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 2.2.1 (2022-02-22)
|
6
|
+
|
7
|
+
### Library changes
|
8
|
+
|
9
|
+
* Let `validate_type_alias` run without an error on unknown type ([\#912](https://github.com/ruby/rbs/pull/912))
|
10
|
+
|
5
11
|
## 2.2.0 (2022-02-22)
|
6
12
|
|
7
13
|
RBS 2.2 ships with a new syntax to specify the visibility of a method per definition bases.
|
@@ -55,7 +55,7 @@ module RBS
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def build_alias_type(name)
|
58
|
-
entry = env.alias_decls[name] or
|
58
|
+
entry = env.alias_decls[name] or return
|
59
59
|
unless entry.decl.type_params.empty?
|
60
60
|
as = entry.decl.type_params.each.map {|param| Types::Variable.new(name: param.name, location: nil) }
|
61
61
|
Types::Alias.new(name: name, args: as, location: nil)
|
@@ -85,9 +85,11 @@ module RBS
|
|
85
85
|
end
|
86
86
|
# @type var each_child: TSort::_EachChild[TypeName]
|
87
87
|
each_child = __skip__ = -> (name, &block) do
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
if env.alias_decls.key?(name)
|
89
|
+
type = builder.expand_alias1(name)
|
90
|
+
each_alias_type(type) do |ty|
|
91
|
+
block[ty.name]
|
92
|
+
end
|
91
93
|
end
|
92
94
|
end
|
93
95
|
|
data/lib/rbs/validator.rb
CHANGED
data/lib/rbs/version.rb
CHANGED
data/sig/validator.rbs
CHANGED
@@ -23,7 +23,9 @@ module RBS
|
|
23
23
|
# - The generics type parameter variance annotation is consistent with respect to their usage
|
24
24
|
# - There is no circular dependencies between the generics type parameter bounds
|
25
25
|
#
|
26
|
-
|
26
|
+
# It yields the rhs type if block is given, so that you can validate the rhs type.
|
27
|
+
#
|
28
|
+
def validate_type_alias: (entry: Environment::SingleEntry[TypeName, AST::Declarations::Alias]) ?{ (Types::t rhs_type) -> void } -> void
|
27
29
|
|
28
30
|
# Validates the type parameters in generic methods.
|
29
31
|
#
|