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/graph/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ def initialize(node, genv, singleton_ty_vtx)
def run0(genv, changes)
instance_tys = []
@singleton_ty_vtx.each_type do |ty|
instance_tys << ty.get_instance_type(genv)
instance_tys << ty.get_instance_type(genv) if ty.is_a?(Type::Singleton)
end
source_vtx = Source.new(*instance_tys)
changes.add_edge(genv, source_vtx, @ret)
Expand Down
15 changes: 15 additions & 0 deletions scenario/control/rescue-assign-with-class-new.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## update: my_error.rb
MyError = Class.new(StandardError)

## update: test.rb
class C
def foo
rescue MyError => e
raise ArgumentError, e.message
end
end

## assert: test.rb
class C
def foo: -> nil
end
16 changes: 16 additions & 0 deletions scenario/control/rescue-assign-with-non-singleton.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## update
NonException = :foo

def foo(n)
1
rescue NonException => e
e
end

## diagnostics

## assert
NonException: :foo
class Object
def foo: (untyped) -> Integer
end