Skip to content

Commit 89a730c

Browse files
committed
Generate a proper error when failing a method match on 1.6.
1 parent 59d94ae commit 89a730c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/jlgen.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,15 @@ function methodinstance(ft::Type, tt::Type, world::Integer=tls_world_age())
224224
sig = typed_signature(ft, tt)
225225

226226
# look-up the method
227-
meth = if VERSION >= v"1.10.0-DEV.65"
228-
Base._which(sig; world).method
227+
if VERSION >= v"1.10.0-DEV.65"
228+
meth = Base._which(sig; world).method
229229
elseif VERSION >= v"1.7.0-DEV.435"
230-
Base._which(sig, world).method
230+
meth = Base._which(sig, world).method
231231
else
232-
ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), sig, world)
232+
meth = ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), sig, world)
233+
if meth == nothing
234+
error("no unique matching method found for the specified argument types")
235+
end
233236
end
234237

235238
(ti, env) = ccall(:jl_type_intersection_with_env, Any,

0 commit comments

Comments
 (0)