Created
July 16, 2019 12:35
-
-
Save yuta0801/32ed2034030a1aafd17a41208d1a0451 to your computer and use it in GitHub Desktop.
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
const f1 = <T>(val: T) => val | |
const f2 = <T>(val: T) => () => val | |
const t1: 'foo' = f1('foo') | |
// const f1: <"foo">(val: "foo") => "foo" | |
const t2: 'foo' = f2('foo')() | |
// const f2: <string>(val: string) => () => string | |
// Type 'string' is not assignable to type '"foo"'. ts(2322) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment