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

feat(tokens): enable type coercion #2680

Merged
merged 2 commits into from
Jun 2, 2019
Merged

Commits on May 30, 2019

  1. feat(tokens): enable type coercion

    relax restrictions on input types for Token.toXxx in order to allow
    flexible type coercion.
    
    this may be needed in situations where users want to force a token
    typed as one type to be represented as another type and generally
    allow tokens to be used as "type-system escape hatches".
    
    Previously, this did not work:
    
        const port = new Token({ "Fn::GetAtt": [ "ResourceId", "Port" ] }).toString(); 
        new TcpPort(new Token(port).toNumber());
    
    Also, this did not work:
    
        const port = new Token({ "Fn::GetAtt": [ "ResourceId", "Port" ]}).toNumber();
    
    Fixes #2679
    Elad Ben-Israel committed May 30, 2019
    Configuration menu
    Copy the full SHA
    5b0730f View commit details
    Browse the repository at this point in the history
  2. fix compilation error

    Elad Ben-Israel committed May 30, 2019
    Configuration menu
    Copy the full SHA
    03865c4 View commit details
    Browse the repository at this point in the history