diff --git a/lib/typeprof/core/ast/sig_type.rb b/lib/typeprof/core/ast/sig_type.rb index cca910ac..362adbbc 100644 --- a/lib/typeprof/core/ast/sig_type.rb +++ b/lib/typeprof/core/ast/sig_type.rb @@ -550,6 +550,8 @@ def initialize(raw_decl, lenv) name = raw_decl.name @cpath = name.namespace.path + [name.name] @toplevel = name.namespace.absolute? + # RBS::Types::ClassSingleton#args was added in RBS 4.0 + @args = raw_decl.respond_to?(:args) ? raw_decl.args.map {|arg| AST.create_rbs_type(arg, lenv) } : [] end attr_reader :cpath, :toplevel diff --git a/scenario/regressions/singleton-show-nil-args.rb b/scenario/regressions/singleton-show-nil-args.rb new file mode 100644 index 00000000..f196896c --- /dev/null +++ b/scenario/regressions/singleton-show-nil-args.rb @@ -0,0 +1,11 @@ +## update +class Foo +end + +#: -> singleton(Foo) +def test + 1 +end + +## diagnostics +(6,2)-(6,3): expected: singleton(::Foo); actual: Integer