Skip to content

Commit 3782ba6

Browse files
committed
More type-asserts for better inference (#42)
1 parent d1f1540 commit 3782ba6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/signatures.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ function methoddef!(@nospecialize(recurse), signatures, frame::Frame, @nospecial
465465
code = framecode.src
466466
codeloc = codelocation(code, pc)
467467
loc = linetable(code, codeloc)
468-
ft = Base.unwrap_unionall(Base.unwrap_unionall(sigt).parameters[1])
468+
ft = Base.unwrap_unionall((Base.unwrap_unionall(sigt)::DataType).parameters[1])
469469
if !startswith(String(ft.name.name), "##")
470470
@warn "file $(loc.file), line $(loc.line): no method found for $sigt"
471471
end
@@ -488,7 +488,8 @@ function methoddef!(@nospecialize(recurse), signatures, frame::Frame, @nospecial
488488
stmt = pc_expr(frame, pc)
489489
end
490490
pc3 = pc
491-
name3 = (stmt::Expr).args[1]
491+
stmt = stmt::Expr
492+
name3 = stmt.args[1]
492493
sigt === nothing && (error("expected a signature"); return next_or_nothing(frame, pc)), pc3
493494
# Methods like f(x::Ref{<:Real}) that use gensymmed typevars will not have the *exact*
494495
# signature of the active method. So let's get the active signature.

0 commit comments

Comments
 (0)