Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
julia> foo = 3
3
julia> function test(a::Type{Val{foo}}) return foo end
test (generic function with 2 methods)
julia> test(Val{foo})
3
julia> foo = 4
4
julia> test(Val{foo})
ERROR: MethodError: `test` has no method matching test(::Type{Val{4}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.