Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Val(x) and f(::Val{x}) #22475

Merged
merged 2 commits into from
Jul 6, 2017
Merged

Use Val(x) and f(::Val{x}) #22475

merged 2 commits into from
Jul 6, 2017

Commits on Jul 5, 2017

  1. Use Val(x) and f(::Val{x})

    Replaces `f(Val{x})` on call sites with `f(Val(x))`, using a new
    `@pure` function `Val(x) = Val{x}()`. This simplifies the method
    definitions from `f(::Type{Val{x}}) where x` to `f(::Val{x}) where x`.
    
    This form also has the advantage that multiple singleton instances
    can be put in a tuple and inference will work (similarly with
    multiple-return functions).
    andyferris authored and Andy Ferris committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    f0a91f7 View commit details
    Browse the repository at this point in the history
  2. Update manual for Val(x) instance usage

    Andy Ferris committed Jul 5, 2017
    Configuration menu
    Copy the full SHA
    2be13f3 View commit details
    Browse the repository at this point in the history