-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference
Description
I was trying to understand the behavior of @pure
(as well as @generated
) and how they relate to the recent fix to #265, and came across this strange case.
I'm not sure why the following code doesn't result in a missing method error on foo
on the last line:
julia> foo(::Int) = 1
foo (generic function with 1 method)
julia> Base.@pure bar(x::ANY) = foo(x)
bar (generic function with 1 method)
julia> bar(42)
1
julia> bar(42.0)
1
The error is (correctly) present on Julia v0.5.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference