Created
April 23, 2021 13:01
-
-
Save alessioprestileo/e684cfbbb399253513229dd7d7935716 to your computer and use it in GitHub Desktop.
Attempts to construct a value of type FString
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FString = string & { __compileTimeOnly: any }; | |
const failure1: FString = 'hello world'; // Error: Type 'string' is not assignable to type '{ __compileTimeOnly: any; }'. | |
const failure2: FString = { __compileTimeOnly: 'whatever' }; // Error: Type '{ __compileTimeOnly: string; }' is not assignable to type 'string'. | |
const success1: FString = 'hello world' as FString; | |
const success2: FString = { __compileTimeOnly: 'whatever' } as FString; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment