Files
test-repo/tests/flow/interface/test.js
T
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00

23 lines
666 B
JavaScript

interface I { y: string }
interface I_ { x: number }
interface J extends I, I_ { }
interface K extends J { }
var k: K = { x: "", y: "" }; // error: x should be number
(k.x: string); // error: x is number
(k.y: string);
declare class C { x: number }
declare class D extends C, Other { } // error: multiple extends
//declare class E implements I { } // parse error
interface A<Y> { y: Y }
interface A_<X> { x: X }
interface B<Z> extends A<string>, A_<Z> { z: Z }
interface E<Z> extends B<Z> { }
var e: E<number> = { x: "", y: "", z: "" }; // error: x and z should be numbers
(e.x: string); // error: x is number
(e.y: string);
(e.z: string); // error: z is number