From fa812c285d13280dc12c285d4538f209bbe1e12b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Jun 2019 09:32:01 -0700 Subject: [PATCH] Update Ember tests to treat 'string & number' and 'never' the same (#36095) * Update tests to treat 'string & number' and 'never' the same * Remove $ExpectType since both 'string & number' or 'never' are ok --- types/ember/test/core-object.ts | 6 +++--- types/ember/test/detect-instance.ts | 2 +- types/ember/v2/test/detect-instance.ts | 2 +- types/ember__object/test/core.ts | 6 +++--- types/ember__object/test/detect-instance.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/types/ember/test/core-object.ts b/types/ember/test/core-object.ts index 984f5eec12..f3ec94cb4d 100644 --- a/types/ember/test/core-object.ts +++ b/types/ember/test/core-object.ts @@ -76,7 +76,7 @@ const co6 = Ember.CoreObject.extend({ this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number } @@ -110,7 +110,7 @@ const co7 = Ember.CoreObject.extend({ this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number } @@ -156,7 +156,7 @@ const co8 = Ember.CoreObject.extend({ this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number // this does not include stuff from later extend args diff --git a/types/ember/test/detect-instance.ts b/types/ember/test/detect-instance.ts index 67b379a113..fdaaef640b 100755 --- a/types/ember/test/detect-instance.ts +++ b/types/ember/test/detect-instance.ts @@ -9,7 +9,7 @@ class ES6Class extends Ember.Object { bar: string; } -const testObject = null; +const testObject: any = null; if (ExtendClass.detectInstance(testObject)) { assertType(testObject.foo); diff --git a/types/ember/v2/test/detect-instance.ts b/types/ember/v2/test/detect-instance.ts index 1b25beb244..d8301bc423 100755 --- a/types/ember/v2/test/detect-instance.ts +++ b/types/ember/v2/test/detect-instance.ts @@ -9,7 +9,7 @@ class ES6Class extends Ember.Object { bar: string; } -let testObject = null; +let testObject: any = null; if (ExtendClass.detectInstance(testObject)) { assertType(testObject.foo); diff --git a/types/ember__object/test/core.ts b/types/ember__object/test/core.ts index 740daa78b0..c671e4007c 100644 --- a/types/ember__object/test/core.ts +++ b/types/ember__object/test/core.ts @@ -78,7 +78,7 @@ const co6 = CoreObject.extend( this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number } @@ -115,7 +115,7 @@ const co7 = CoreObject.extend( this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number } @@ -165,7 +165,7 @@ const co8 = CoreObject.extend( this.init; // $ExpectType () => void // this includes stuff from this extend-arg // TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291 - this.foo; // $ExpectType string & number + this.foo; // this includes stuff from earlier extend-args this.bar; // $ExpectType number // this does not include stuff from later extend args diff --git a/types/ember__object/test/detect-instance.ts b/types/ember__object/test/detect-instance.ts index d65fa0f686..0ec74ce437 100755 --- a/types/ember__object/test/detect-instance.ts +++ b/types/ember__object/test/detect-instance.ts @@ -9,7 +9,7 @@ class ES6Class extends EmberObject { bar: string; } -const testObject = null; +const testObject: any = null; if (ExtendClass.detectInstance(testObject)) { assertType(testObject.foo);