Last active
August 29, 2015 14:15
-
-
Save NicolaeNMV/efc9c1c4a0bff1c5782d to your computer and use it in GitHub Desktop.
Flow type VS Typescript at detecting non existing JSON elements
This file contains 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
/* @flow */ | |
var a = { | |
"a":"a", | |
"b":"b" | |
} | |
var res = a.c; | |
// $ flow simple.js | |
// $ No errors! | |
// $ tsc simple.ts | |
// $ simple.ts(7,13): error TS2339: Property 'c' does not exist on type '{ "a": string; "b": string; }'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment