Add cases and baselines from #6211 and #6210

This commit is contained in:
Nathan Shively-Sanders 2016-02-19 11:33:32 -08:00
parent e46b7b05ab
commit eacc092f87
3 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,50 @@
tests/cases/compiler/nonIdenticalTypeConstraints.ts(10,11): error TS2428: All declarations must have identical type parameters.
tests/cases/compiler/nonIdenticalTypeConstraints.ts(16,7): error TS2428: All declarations must have identical type parameters.
tests/cases/compiler/nonIdenticalTypeConstraints.ts(36,11): error TS2428: All declarations must have identical type parameters.
==== tests/cases/compiler/nonIdenticalTypeConstraints.ts (3 errors) ====
class Different {
a: number;
b: string;
c: boolean;
}
class Foo<T extends Function> {
n: T;
}
interface Foo<T extends Different> {
~~~
!!! error TS2428: All declarations must have identical type parameters.
y: T;
}
interface Qux<T extends Different> {
y: T;
}
class Qux<T extends Function> {
~~~
!!! error TS2428: All declarations must have identical type parameters.
n: T;
}
class Bar<T extends Function> {
n: T;
}
interface Bar<T extends Function> {
y: T;
}
interface Baz<T extends Function> {
y: T;
}
class Baz<T extends Function> {
n: T;
}
class Quux<T> {
n: T;
}
interface Quux<U> {
~~~~
!!! error TS2428: All declarations must have identical type parameters.
m: U;
}

View File

@ -0,0 +1,71 @@
//// [nonIdenticalTypeConstraints.ts]
class Different {
a: number;
b: string;
c: boolean;
}
class Foo<T extends Function> {
n: T;
}
interface Foo<T extends Different> {
y: T;
}
interface Qux<T extends Different> {
y: T;
}
class Qux<T extends Function> {
n: T;
}
class Bar<T extends Function> {
n: T;
}
interface Bar<T extends Function> {
y: T;
}
interface Baz<T extends Function> {
y: T;
}
class Baz<T extends Function> {
n: T;
}
class Quux<T> {
n: T;
}
interface Quux<U> {
m: U;
}
//// [nonIdenticalTypeConstraints.js]
var Different = (function () {
function Different() {
}
return Different;
}());
var Foo = (function () {
function Foo() {
}
return Foo;
}());
var Qux = (function () {
function Qux() {
}
return Qux;
}());
var Bar = (function () {
function Bar() {
}
return Bar;
}());
var Baz = (function () {
function Baz() {
}
return Baz;
}());
var Quux = (function () {
function Quux() {
}
return Quux;
}());

View File

@ -0,0 +1,38 @@
class Different {
a: number;
b: string;
c: boolean;
}
class Foo<T extends Function> {
n: T;
}
interface Foo<T extends Different> {
y: T;
}
interface Qux<T extends Different> {
y: T;
}
class Qux<T extends Function> {
n: T;
}
class Bar<T extends Function> {
n: T;
}
interface Bar<T extends Function> {
y: T;
}
interface Baz<T extends Function> {
y: T;
}
class Baz<T extends Function> {
n: T;
}
class Quux<T> {
n: T;
}
interface Quux<U> {
m: U;
}