Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lkuper
Created August 11, 2016 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkuper/fabc35b8f59aebb1cbf28337834f16d0 to your computer and use it in GitHub Desktop.
Save lkuper/fabc35b8f59aebb1cbf28337834f16d0 to your computer and use it in GitHub Desktop.
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