steep 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +27 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +5 -0
- data/README.md +48 -90
- data/Rakefile +10 -6
- data/Steepfile +1 -0
- data/bin/setup +1 -0
- data/bin/smoke_runner.rb +9 -14
- data/exe/rbs +3 -0
- data/exe/ruby-signature +3 -0
- data/exe/steep +1 -0
- data/lib/steep.rb +32 -26
- data/lib/steep/annotation_parser.rb +167 -0
- data/lib/steep/ast/annotation/collection.rb +7 -7
- data/lib/steep/ast/types.rb +60 -0
- data/lib/steep/ast/types/any.rb +1 -1
- data/lib/steep/ast/types/factory.rb +535 -0
- data/lib/steep/ast/types/name.rb +3 -3
- data/lib/steep/ast/types/var.rb +1 -1
- data/lib/steep/cli.rb +56 -240
- data/lib/steep/drivers/annotations.rb +36 -19
- data/lib/steep/drivers/check.rb +55 -91
- data/lib/steep/drivers/init.rb +54 -0
- data/lib/steep/drivers/langserver.rb +241 -150
- data/lib/steep/drivers/print_project.rb +56 -0
- data/lib/steep/drivers/signature_error_printer.rb +25 -0
- data/lib/steep/drivers/trace_printer.rb +25 -0
- data/lib/steep/drivers/utils/driver_helper.rb +26 -0
- data/lib/steep/drivers/validate.rb +18 -38
- data/lib/steep/drivers/vendor.rb +46 -0
- data/lib/steep/drivers/watch.rb +78 -140
- data/lib/steep/errors.rb +22 -13
- data/lib/steep/interface/interface.rb +91 -0
- data/lib/steep/interface/method.rb +0 -4
- data/lib/steep/interface/method_type.rb +362 -2
- data/lib/steep/interface/substitution.rb +22 -0
- data/lib/steep/project.rb +25 -233
- data/lib/steep/project/dsl.rb +132 -0
- data/lib/steep/project/file.rb +93 -76
- data/lib/steep/project/file_loader.rb +63 -0
- data/lib/steep/project/options.rb +7 -0
- data/lib/steep/project/target.rb +190 -0
- data/lib/steep/signature/errors.rb +25 -77
- data/lib/steep/signature/validator.rb +122 -0
- data/lib/steep/source.rb +12 -7
- data/lib/steep/subtyping/check.rb +357 -633
- data/lib/steep/subtyping/constraints.rb +2 -2
- data/lib/steep/subtyping/trace.rb +23 -0
- data/lib/steep/type_construction.rb +509 -455
- data/lib/steep/type_inference/constant_env.rb +16 -24
- data/lib/steep/type_inference/type_env.rb +26 -18
- data/lib/steep/version.rb +1 -1
- data/sample/Steepfile +6 -0
- data/sample/lib/conference.rb +12 -0
- data/sample/sig/conference.rbs +6 -0
- data/smoke/alias/Steepfile +4 -0
- data/smoke/alias/a.rb +2 -2
- data/smoke/alias/{a.rbi → a.rbs} +1 -1
- data/smoke/and/Steepfile +4 -0
- data/smoke/array/Steepfile +4 -0
- data/smoke/array/a.rb +2 -2
- data/smoke/array/b.rb +4 -4
- data/smoke/array/c.rb +2 -2
- data/smoke/block/Steepfile +5 -0
- data/smoke/block/{a.rbi → a.rbs} +1 -1
- data/smoke/block/{c.rbi → c.rbs} +0 -0
- data/smoke/block/d.rb +6 -6
- data/smoke/case/Steepfile +4 -0
- data/smoke/case/a.rb +4 -3
- data/smoke/class/Steepfile +4 -0
- data/smoke/class/a.rb +1 -4
- data/smoke/class/a.rbs +24 -0
- data/smoke/class/h.rb +6 -2
- data/smoke/class/{h.rbi → h.rbs} +1 -2
- data/smoke/class/i.rb +1 -2
- data/smoke/class/i.rbs +9 -0
- data/smoke/const/Steepfile +4 -0
- data/smoke/dstr/Steepfile +4 -0
- data/smoke/ensure/Steepfile +4 -0
- data/smoke/ensure/a.rb +1 -1
- data/smoke/enumerator/Steepfile +4 -0
- data/smoke/enumerator/a.rb +7 -7
- data/smoke/enumerator/b.rb +6 -6
- data/smoke/extension/Steepfile +4 -0
- data/smoke/extension/{a.rbi → a.rbs} +2 -2
- data/smoke/extension/{e.rbi → e.rbs} +2 -2
- data/smoke/hash/Steepfile +4 -0
- data/smoke/hash/{a.rbi → a.rbs} +0 -0
- data/smoke/hash/b.rb +2 -2
- data/smoke/hash/c.rb +1 -1
- data/smoke/hash/e.rbs +3 -0
- data/smoke/hash/f.rb +1 -1
- data/smoke/hello/Steepfile +4 -0
- data/smoke/hello/hello.rbs +7 -0
- data/smoke/if/Steepfile +4 -0
- data/smoke/implements/Steepfile +4 -0
- data/smoke/implements/a.rbs +6 -0
- data/smoke/initialize/Steepfile +4 -0
- data/smoke/initialize/a.rbs +3 -0
- data/smoke/integer/Steepfile +4 -0
- data/smoke/integer/a.rb +5 -3
- data/smoke/interface/Steepfile +4 -0
- data/smoke/interface/{a.rbi → a.rbs} +0 -0
- data/smoke/kwbegin/Steepfile +4 -0
- data/smoke/lambda/Steepfile +4 -0
- data/smoke/lambda/a.rb +9 -2
- data/smoke/literal/Steepfile +4 -0
- data/smoke/literal/{literal_methods.rbi → literal_methods.rbs} +0 -0
- data/smoke/map/Steepfile +4 -0
- data/smoke/map/a.rb +1 -1
- data/smoke/method/Steepfile +4 -0
- data/smoke/method/{a.rbi → a.rbs} +0 -0
- data/smoke/method/b.rb +1 -4
- data/smoke/method/d.rb +1 -0
- data/smoke/method/d.rbs +3 -0
- data/smoke/module/Steepfile +4 -0
- data/smoke/module/a.rb +1 -1
- data/smoke/module/a.rbs +16 -0
- data/smoke/module/c.rb +1 -1
- data/smoke/regexp/Steepfile +4 -0
- data/smoke/regexp/a.rb +2 -2
- data/smoke/regexp/b.rb +16 -16
- data/smoke/regression/Steepfile +5 -0
- data/smoke/regression/array.rb +2 -2
- data/smoke/regression/hash.rb +2 -2
- data/smoke/regression/poly_new.rb +2 -0
- data/smoke/regression/poly_new.rbs +4 -0
- data/smoke/regression/set_divide.rb +2 -2
- data/smoke/rescue/Steepfile +4 -0
- data/smoke/rescue/a.rb +1 -1
- data/smoke/self/Steepfile +4 -0
- data/smoke/self/a.rbs +4 -0
- data/smoke/skip/Steepfile +4 -0
- data/smoke/stdout/Steepfile +4 -0
- data/smoke/stdout/{a.rbi → a.rbs} +1 -1
- data/smoke/super/Steepfile +4 -0
- data/smoke/super/a.rbs +10 -0
- data/smoke/type_case/Steepfile +4 -0
- data/smoke/type_case/a.rb +1 -1
- data/smoke/yield/Steepfile +4 -0
- data/smoke/yield/a.rb +2 -2
- data/steep.gemspec +14 -7
- data/vendor/ruby-signature/.github/workflows/ruby.yml +27 -0
- data/vendor/ruby-signature/.gitignore +12 -0
- data/vendor/ruby-signature/.rubocop.yml +15 -0
- data/vendor/ruby-signature/BSDL +22 -0
- data/vendor/ruby-signature/COPYING +56 -0
- data/vendor/ruby-signature/Gemfile +6 -0
- data/vendor/ruby-signature/README.md +93 -0
- data/vendor/ruby-signature/Rakefile +66 -0
- data/vendor/ruby-signature/bin/annotate-with-rdoc +156 -0
- data/vendor/ruby-signature/bin/console +14 -0
- data/vendor/ruby-signature/bin/query-rdoc +103 -0
- data/vendor/ruby-signature/bin/setup +10 -0
- data/vendor/ruby-signature/bin/sort +88 -0
- data/vendor/ruby-signature/bin/test_runner.rb +17 -0
- data/vendor/ruby-signature/docs/CONTRIBUTING.md +97 -0
- data/vendor/ruby-signature/docs/sigs.md +148 -0
- data/vendor/ruby-signature/docs/stdlib.md +152 -0
- data/vendor/ruby-signature/docs/syntax.md +528 -0
- data/vendor/ruby-signature/exe/rbs +3 -0
- data/vendor/ruby-signature/exe/ruby-signature +7 -0
- data/vendor/ruby-signature/lib/ruby/signature.rb +64 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +391 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +364 -0
- data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +52 -0
- data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +54 -0
- data/vendor/ruby-signature/lib/ruby/signature/cli.rb +534 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +152 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition.rb +172 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +921 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment.rb +283 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +138 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +126 -0
- data/vendor/ruby-signature/lib/ruby/signature/errors.rb +189 -0
- data/vendor/ruby-signature/lib/ruby/signature/location.rb +104 -0
- data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +125 -0
- data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +93 -0
- data/vendor/ruby-signature/lib/ruby/signature/parser.y +1343 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +441 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +579 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +383 -0
- data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +48 -0
- data/vendor/ruby-signature/lib/ruby/signature/test.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +63 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +290 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +58 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +324 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +185 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +256 -0
- data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +72 -0
- data/vendor/ruby-signature/lib/ruby/signature/types.rb +932 -0
- data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +140 -0
- data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +49 -0
- data/vendor/ruby-signature/lib/ruby/signature/version.rb +5 -0
- data/vendor/ruby-signature/lib/ruby/signature/writer.rb +271 -0
- data/vendor/ruby-signature/ruby-signature.gemspec +45 -0
- data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +3 -0
- data/vendor/ruby-signature/stdlib/base64/base64.rbs +15 -0
- data/vendor/ruby-signature/stdlib/builtin/array.rbs +1997 -0
- data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +280 -0
- data/vendor/ruby-signature/stdlib/builtin/binding.rbs +177 -0
- data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +35 -0
- data/vendor/ruby-signature/stdlib/builtin/class.rbs +145 -0
- data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +116 -0
- data/vendor/ruby-signature/stdlib/builtin/complex.rbs +400 -0
- data/vendor/ruby-signature/stdlib/builtin/constants.rbs +37 -0
- data/vendor/ruby-signature/stdlib/builtin/data.rbs +5 -0
- data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +2 -0
- data/vendor/ruby-signature/stdlib/builtin/dir.rbs +419 -0
- data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +606 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +404 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +260 -0
- data/vendor/ruby-signature/stdlib/builtin/errno.rbs +781 -0
- data/vendor/ruby-signature/stdlib/builtin/errors.rbs +582 -0
- data/vendor/ruby-signature/stdlib/builtin/exception.rbs +193 -0
- data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +68 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +12 -0
- data/vendor/ruby-signature/stdlib/builtin/file.rbs +476 -0
- data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +59 -0
- data/vendor/ruby-signature/stdlib/builtin/float.rbs +696 -0
- data/vendor/ruby-signature/stdlib/builtin/gc.rbs +121 -0
- data/vendor/ruby-signature/stdlib/builtin/hash.rbs +1029 -0
- data/vendor/ruby-signature/stdlib/builtin/integer.rbs +710 -0
- data/vendor/ruby-signature/stdlib/builtin/io.rbs +683 -0
- data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +574 -0
- data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +135 -0
- data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +141 -0
- data/vendor/ruby-signature/stdlib/builtin/math.rbs +66 -0
- data/vendor/ruby-signature/stdlib/builtin/method.rbs +182 -0
- data/vendor/ruby-signature/stdlib/builtin/module.rbs +248 -0
- data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +82 -0
- data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +409 -0
- data/vendor/ruby-signature/stdlib/builtin/object.rbs +824 -0
- data/vendor/ruby-signature/stdlib/builtin/proc.rbs +426 -0
- data/vendor/ruby-signature/stdlib/builtin/process.rbs +354 -0
- data/vendor/ruby-signature/stdlib/builtin/random.rbs +93 -0
- data/vendor/ruby-signature/stdlib/builtin/range.rbs +226 -0
- data/vendor/ruby-signature/stdlib/builtin/rational.rbs +424 -0
- data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +10 -0
- data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +131 -0
- data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +14 -0
- data/vendor/ruby-signature/stdlib/builtin/signal.rbs +55 -0
- data/vendor/ruby-signature/stdlib/builtin/string.rbs +770 -0
- data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +13 -0
- data/vendor/ruby-signature/stdlib/builtin/struct.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +230 -0
- data/vendor/ruby-signature/stdlib/builtin/thread.rbs +1112 -0
- data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +23 -0
- data/vendor/ruby-signature/stdlib/builtin/time.rbs +739 -0
- data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +91 -0
- data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +46 -0
- data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +159 -0
- data/vendor/ruby-signature/stdlib/builtin/warning.rbs +17 -0
- data/vendor/ruby-signature/stdlib/erb/erb.rbs +18 -0
- data/vendor/ruby-signature/stdlib/find/find.rbs +44 -0
- data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +21 -0
- data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +23 -0
- data/vendor/ruby-signature/stdlib/prime/prime.rbs +188 -0
- data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +9 -0
- data/vendor/ruby-signature/stdlib/set/set.rbs +77 -0
- data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +53 -0
- metadata +244 -54
- data/.travis.yml +0 -7
- data/lib/steep/ast/signature/alias.rb +0 -19
- data/lib/steep/ast/signature/class.rb +0 -33
- data/lib/steep/ast/signature/const.rb +0 -17
- data/lib/steep/ast/signature/env.rb +0 -138
- data/lib/steep/ast/signature/extension.rb +0 -21
- data/lib/steep/ast/signature/gvar.rb +0 -17
- data/lib/steep/ast/signature/interface.rb +0 -31
- data/lib/steep/ast/signature/members.rb +0 -115
- data/lib/steep/ast/signature/module.rb +0 -21
- data/lib/steep/drivers/print_interface.rb +0 -94
- data/lib/steep/drivers/scaffold.rb +0 -321
- data/lib/steep/drivers/utils/each_signature.rb +0 -31
- data/lib/steep/interface/abstract.rb +0 -68
- data/lib/steep/interface/builder.rb +0 -637
- data/lib/steep/interface/instantiated.rb +0 -163
- data/lib/steep/interface/ivar_chain.rb +0 -26
- data/lib/steep/parser.y +0 -1278
- data/lib/steep/project/listener.rb +0 -53
- data/smoke/class/a.rbi +0 -24
- data/smoke/class/d.rb +0 -9
- data/smoke/class/e.rb +0 -12
- data/smoke/class/i.rbi +0 -9
- data/smoke/hash/e.rbi +0 -3
- data/smoke/hello/hello.rbi +0 -7
- data/smoke/implements/a.rbi +0 -6
- data/smoke/initialize/a.rbi +0 -3
- data/smoke/module/a.rbi +0 -16
- data/smoke/self/a.rbi +0 -4
- data/smoke/super/a.rbi +0 -10
- data/stdlib/builtin.rbi +0 -787
data/smoke/class/i.rbs
ADDED
data/smoke/ensure/a.rb
CHANGED
data/smoke/enumerator/a.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
# @type var hash: Hash
|
1
|
+
# @type var hash: Hash[Symbol, String]
|
2
2
|
|
3
3
|
a = [1]
|
4
4
|
|
5
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
5
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::String
|
6
6
|
hash = a.each.with_object("") do |x, y|
|
7
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
7
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::Integer
|
8
8
|
hash = x
|
9
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
9
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::String
|
10
10
|
hash = y
|
11
11
|
end
|
12
12
|
|
13
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
13
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::Array[::Integer]
|
14
14
|
hash = a.each.with_index do |x, y|
|
15
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
15
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::Integer
|
16
16
|
hash = x
|
17
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
17
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, ::String], rhs_type=::Integer
|
18
18
|
hash = y
|
19
19
|
end
|
data/smoke/enumerator/b.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
# @type var b: Array
|
2
|
-
# @type var c: Array
|
1
|
+
# @type var b: Array[String]
|
2
|
+
# @type var c: Array[Integer]
|
3
3
|
|
4
4
|
a = [1]
|
5
5
|
|
6
|
-
# !expects*
|
6
|
+
# !expects* UnresolvedOverloading:
|
7
7
|
b = a.each.with_object([]) do |i, xs|
|
8
8
|
# @type var xs: String
|
9
9
|
xs << i.to_s
|
10
10
|
end
|
11
11
|
|
12
|
-
# !expects IncompatibleAssignment: lhs_type=::Array
|
12
|
+
# !expects IncompatibleAssignment: lhs_type=::Array[::Integer], rhs_type=::Array[::String]
|
13
13
|
c = a.each.with_object([]) do |i, xs|
|
14
|
-
# @type var xs: Array
|
14
|
+
# @type var xs: Array[String]
|
15
15
|
xs << i.to_s
|
16
16
|
end
|
17
17
|
|
18
18
|
# @type var d: String
|
19
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Array
|
19
|
+
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Array[untyped]
|
20
20
|
d = a.each.with_object([]) do |i, xs|
|
21
21
|
xs << i.to_s
|
22
22
|
end
|
data/smoke/hash/{a.rbi → a.rbs}
RENAMED
File without changes
|
data/smoke/hash/b.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# @type var x: Hash
|
1
|
+
# @type var x: Hash[Symbol, String?]
|
2
2
|
|
3
3
|
x = { foo: "foo" }
|
4
4
|
x = { foo: nil }
|
5
5
|
|
6
|
-
# !expects IncompatibleAssignment: lhs_type=::Hash
|
6
|
+
# !expects IncompatibleAssignment: lhs_type=::Hash[::Symbol, (::String | nil)], rhs_type=::Hash[::Symbol, ::Integer]
|
7
7
|
x = { foo: 3 }
|
data/smoke/hash/c.rb
CHANGED
@@ -9,7 +9,7 @@ name = params[:name]
|
|
9
9
|
# !expects NoMethodError: type=::String, method=abcdefg
|
10
10
|
name.abcdefg
|
11
11
|
|
12
|
-
# !expects NoMethodError: type=(::Integer | ::String
|
12
|
+
# !expects NoMethodError: type=(::Integer | ::String), method=abcdefg
|
13
13
|
params[(_=nil) ? :id : :name].abcdefg
|
14
14
|
|
15
15
|
# @type var controller: Controller
|
data/smoke/hash/e.rbs
ADDED
data/smoke/hash/f.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# @type method commit: (Hash
|
1
|
+
# @type method commit: (Hash[Symbol, String?]) -> { repo: String, branch: String?, tag: String?, commit: String? }?
|
2
2
|
def commit(hash)
|
3
3
|
if repo = hash[:foo]
|
4
4
|
{
|
data/smoke/if/Steepfile
ADDED
data/smoke/integer/a.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# @type var x: Numeric
|
2
|
+
x = _ = 1
|
3
|
+
integer_1 = Integer(x)
|
2
4
|
# !expects NoMethodError: type=::Integer, method=foo
|
3
5
|
integer_1.foo
|
4
6
|
|
@@ -24,8 +26,8 @@ integer_5 = Integer("10", 2)
|
|
24
26
|
# !expects NoMethodError: type=::Integer, method=foo
|
25
27
|
integer_5.foo
|
26
28
|
|
27
|
-
# !expects
|
29
|
+
# !expects* UnresolvedOverloading: receiver=::Object, method_name=Integer,
|
28
30
|
Integer(Object.new)
|
29
31
|
|
30
|
-
# !expects
|
32
|
+
# !expects* UnresolvedOverloading: receiver=::Object, method_name=Integer,
|
31
33
|
Integer(nil)
|
File without changes
|
data/smoke/lambda/a.rb
CHANGED
@@ -7,5 +7,12 @@ a = -> (x, y) do
|
|
7
7
|
x + y
|
8
8
|
end["foo", "bar"]
|
9
9
|
|
10
|
-
#
|
11
|
-
|
10
|
+
# @type var b: ^(Integer) -> Integer
|
11
|
+
# !expects IncompatibleAssignment: lhs_type=^(::Integer) -> ::Integer, rhs_type=::Proc
|
12
|
+
b = lambda do |x|
|
13
|
+
# !expects NoMethodError: type=nil, method=+
|
14
|
+
x + 1
|
15
|
+
end
|
16
|
+
|
17
|
+
# @type var c: ^(Integer) -> Integer
|
18
|
+
c = -> (x) { x + 1 }
|
File without changes
|
data/smoke/map/Steepfile
ADDED
data/smoke/map/a.rb
CHANGED
File without changes
|
data/smoke/method/b.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
class A
|
2
2
|
# @implements X
|
3
3
|
|
4
|
-
# !expects*@+2 MethodDefinitionWithOverloading: method=foo, types=
|
5
4
|
# !expects MethodBodyTypeMismatch: method=foo, expected=(::Integer | ::String), actual=::Symbol
|
6
5
|
def foo(x)
|
7
6
|
:foobar
|
@@ -11,7 +10,7 @@ end
|
|
11
10
|
class B
|
12
11
|
# @implements X
|
13
12
|
|
14
|
-
# @type method foo: (::String | ::Integer) ->
|
13
|
+
# @type method foo: (::String | ::Integer) -> untyped
|
15
14
|
def foo(x)
|
16
15
|
3
|
17
16
|
end
|
@@ -21,8 +20,6 @@ class C
|
|
21
20
|
# @implements X
|
22
21
|
|
23
22
|
# @type method foo: (Symbol) -> Symbol
|
24
|
-
|
25
|
-
# !expects IncompatibleMethodTypeAnnotation: interface_method=::X.foo, annotation_method=foo
|
26
23
|
def foo(x)
|
27
24
|
:foo
|
28
25
|
end
|
data/smoke/method/d.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
KeywordMethod.new.hello(type: 123)
|
data/smoke/method/d.rbs
ADDED
data/smoke/module/a.rb
CHANGED
@@ -13,7 +13,7 @@ module A
|
|
13
13
|
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
14
14
|
s = n
|
15
15
|
|
16
|
-
# !expects NoMethodError: type=(::A & ::Object & ::
|
16
|
+
# !expects NoMethodError: type=(::A & ::Object & ::_Each2[::Integer, ::A]), method=foo
|
17
17
|
foo()
|
18
18
|
|
19
19
|
n
|
data/smoke/module/a.rbs
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
interface _Each2[A, B]
|
2
|
+
def each: { (A) -> untyped } -> B
|
3
|
+
end
|
4
|
+
|
5
|
+
module A : _Each2[Integer, A]
|
6
|
+
def count: () -> Integer
|
7
|
+
end
|
8
|
+
|
9
|
+
module X
|
10
|
+
def foo: () -> Integer
|
11
|
+
end
|
12
|
+
|
13
|
+
module Palette
|
14
|
+
def self?.defacto_palette: -> Array[Array[Integer]]
|
15
|
+
def self.nestopia_palette: -> Array[Array[Integer]]
|
16
|
+
end
|
data/smoke/module/c.rb
CHANGED
data/smoke/regexp/a.rb
CHANGED
@@ -127,11 +127,11 @@ match_q_2 = /a/.match?("a", 0)
|
|
127
127
|
match_q_2.foo
|
128
128
|
|
129
129
|
named_captures_1 = /(?<foo>.)/.named_captures
|
130
|
-
# !expects NoMethodError: type=::Hash
|
130
|
+
# !expects NoMethodError: type=::Hash[::String, ::Array[::Integer]], method=foo
|
131
131
|
named_captures_1.foo
|
132
132
|
|
133
133
|
names_1 = /(?<foo>.)/.names
|
134
|
-
# !expects NoMethodError: type=::Array
|
134
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
135
135
|
names_1.foo
|
136
136
|
|
137
137
|
options_1 = /a/ix.options
|
data/smoke/regexp/b.rb
CHANGED
@@ -12,11 +12,11 @@
|
|
12
12
|
match_ref_3.foo
|
13
13
|
|
14
14
|
match_ref_4 = match[0, 1]
|
15
|
-
# !expects NoMethodError: type=::Array
|
15
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
16
16
|
match_ref_4.foo
|
17
17
|
|
18
18
|
match_ref_5 = match[0..1]
|
19
|
-
# !expects NoMethodError: type=::Array
|
19
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
20
20
|
match_ref_5.foo
|
21
21
|
|
22
22
|
begin_1 = match.begin(0)
|
@@ -24,27 +24,27 @@
|
|
24
24
|
begin_1.foo
|
25
25
|
|
26
26
|
begin_2 = match.begin("foo")
|
27
|
-
# !expects NoMethodError: type
|
27
|
+
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
28
28
|
begin_2.foo
|
29
29
|
|
30
30
|
begin_3 = match.begin(:foo)
|
31
|
-
# !expects NoMethodError: type
|
31
|
+
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
32
32
|
begin_3.foo
|
33
33
|
|
34
34
|
captures_1 = match.captures
|
35
|
-
# !expects NoMethodError: type=::Array
|
35
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
36
36
|
captures_1.foo
|
37
37
|
|
38
38
|
end_1 = match.end(0)
|
39
|
-
# !expects NoMethodError: type
|
39
|
+
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
40
40
|
end_1.foo
|
41
41
|
|
42
42
|
end_2 = match.end("foo")
|
43
|
-
# !expects NoMethodError: type
|
43
|
+
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
44
44
|
end_2.foo
|
45
45
|
|
46
46
|
end_3 = match.end(:foo)
|
47
|
-
# !expects NoMethodError: type
|
47
|
+
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
48
48
|
end_3.foo
|
49
49
|
|
50
50
|
length_1 = match.length
|
@@ -52,23 +52,23 @@
|
|
52
52
|
length_1.foo
|
53
53
|
|
54
54
|
named_captures_1 = match.named_captures
|
55
|
-
# !expects NoMethodError: type=::Hash
|
55
|
+
# !expects NoMethodError: type=::Hash[::String, (::String | nil)], method=foo
|
56
56
|
named_captures_1.foo
|
57
57
|
|
58
58
|
names_1 = match.names
|
59
|
-
# !expects NoMethodError: type=::Array
|
59
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
60
60
|
names_1.foo
|
61
61
|
|
62
62
|
offset_1 = match.offset(0)
|
63
|
-
# !expects NoMethodError: type=[::Integer, ::Integer], method=foo
|
63
|
+
# !expects NoMethodError: type=([::Integer, ::Integer] | [nil, nil]), method=foo
|
64
64
|
offset_1.foo
|
65
65
|
|
66
66
|
offset_2 = match.offset("foo")
|
67
|
-
# !expects NoMethodError: type=[::Integer, ::Integer], method=foo
|
67
|
+
# !expects NoMethodError: type=([::Integer, ::Integer] | [nil, nil]), method=foo
|
68
68
|
offset_2.foo
|
69
69
|
|
70
70
|
offset_3 = match.offset(:foo)
|
71
|
-
# !expects NoMethodError: type=[::Integer, ::Integer], method=foo
|
71
|
+
# !expects NoMethodError: type=([::Integer, ::Integer] | [nil, nil]), method=foo
|
72
72
|
offset_3.foo
|
73
73
|
|
74
74
|
post_match_1 = match.post_match
|
@@ -92,14 +92,14 @@
|
|
92
92
|
string_1.foo
|
93
93
|
|
94
94
|
to_a_1 = match.to_a
|
95
|
-
# !expects NoMethodError: type=::Array
|
95
|
+
# !expects NoMethodError: type=::Array[::String], method=foo
|
96
96
|
to_a_1.foo
|
97
97
|
|
98
98
|
values_at_1 = match.values_at
|
99
|
-
# !expects NoMethodError: type=::Array
|
99
|
+
# !expects NoMethodError: type=::Array[(::String | nil)], method=foo
|
100
100
|
values_at_1.foo
|
101
101
|
|
102
102
|
values_at_2 = match.values_at(0, "foo", :foo)
|
103
|
-
# !expects NoMethodError: type=::Array
|
103
|
+
# !expects NoMethodError: type=::Array[(::String | nil)], method=foo
|
104
104
|
values_at_2.foo
|
105
105
|
end
|