diff --git a/src/execution/__tests__/union-interface-test.js b/src/execution/__tests__/union-interface-test.js index 43941e5b0e..3c664e8875 100644 --- a/src/execution/__tests__/union-interface-test.js +++ b/src/execution/__tests__/union-interface-test.js @@ -21,15 +21,13 @@ import { execute } from '../execute'; class Dog { name: string; barks: boolean; - mother: Dog | null; - father: Dog | null; + mother: Dog | void; + father: Dog | void; progeny: Array; constructor(name: string, barks: boolean) { this.name = name; this.barks = barks; - this.mother = null; - this.father = null; this.progeny = []; } } @@ -37,25 +35,27 @@ class Dog { class Cat { name: string; meows: boolean; - mother: ?Cat; - father: ?Cat; + mother: Cat | void; + father: Cat | void; progeny: Array; - constructor(name, meows) { + constructor(name: string, meows: boolean) { this.name = name; this.meows = meows; - this.mother = null; - this.father = null; this.progeny = []; } } class Person { name: string; - pets: ?Array; - friends: ?Array; - - constructor(name, pets, friends) { + pets: Array | void; + friends: Array | void; + + constructor( + name: string, + pets?: Array, + friends?: Array | void, + ) { this.name = name; this.pets = pets; this.friends = friends;