Open ksss opened 1 year ago
I'm not sure if this is rbs issue or steep issue, but I voted for this one because it is reproduced when both annotations and if statements are used.
$ cat sample.rb # @type var foo: Foo foo = Foo.new if foo.bar end
$ cat Steepfile target :sample do check "sample.rb" end
steep: 3cf26497c92c8659e76ea970102dff37f2318da3 (current master) rbs: v2.7.0
$ ruby -v ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [arm64-darwin21]
Interesting.
If the @type var annotation is not given, the type of foo is untyped, which is inferred by the right hand side. But, this is ::Foo while Steep doesn't know what the type is exactly!
@type var
foo
untyped
::Foo
I'm not sure if this is rbs issue or steep issue, but I voted for this one because it is reproduced when both annotations and if statements are used.
$ bundle exec steep check
``` $ bundle exec steep check # Type checking files: ............................................................................[Steep 1.2.0] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(2:1)] [synthesize:(3:1)] [synthesize:(3:4)] Unexpected error: #steep: 3cf26497c92c8659e76ea970102dff37f2318da3 (current master) rbs: v2.7.0