Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/typeprof/core/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.collect_hash_value_types(type)

def self.default_param_map(genv, ty)
ty = ty.base_type(genv)
instance_ty = ty.is_a?(Type::Instance) ? ty : Type::Instance.new(genv, ty.mod, []) # TODO: type params
instance_ty = ty.is_a?(Type::Instance) ? ty : ty.get_instance_type(genv)
singleton_ty = ty.is_a?(Type::Instance) ? Type::Singleton.new(genv, ty.mod) : ty
{
"*self": Source.new(ty),
Expand Down
25 changes: 25 additions & 0 deletions scenario/rbs/instance-type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## update: test.rbs
class Gen[T]
def self.create: () -> instance
end

type gen[T] = Gen[T]

class Object
def accept: (gen[Integer]) -> String
end

## update: test.rb
def test
accept(Gen.create)
end

def raw
Gen.create
end

## assert
class Object
def test: -> String
def raw: -> Gen[untyped]
end
Loading