diff --git a/tests/baselines/reference/nonIdenticalTypeConstraints.errors.txt b/tests/baselines/reference/nonIdenticalTypeConstraints.errors.txt new file mode 100644 index 00000000000..a8b54bf44dd --- /dev/null +++ b/tests/baselines/reference/nonIdenticalTypeConstraints.errors.txt @@ -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 { + n: T; + } + interface Foo { + ~~~ +!!! error TS2428: All declarations must have identical type parameters. + y: T; + } + interface Qux { + y: T; + } + class Qux { + ~~~ +!!! error TS2428: All declarations must have identical type parameters. + n: T; + } + + class Bar { + n: T; + } + interface Bar { + y: T; + } + interface Baz { + y: T; + } + class Baz { + n: T; + } + + class Quux { + n: T; + } + interface Quux { + ~~~~ +!!! error TS2428: All declarations must have identical type parameters. + m: U; + } \ No newline at end of file diff --git a/tests/baselines/reference/nonIdenticalTypeConstraints.js b/tests/baselines/reference/nonIdenticalTypeConstraints.js new file mode 100644 index 00000000000..73748f63885 --- /dev/null +++ b/tests/baselines/reference/nonIdenticalTypeConstraints.js @@ -0,0 +1,71 @@ +//// [nonIdenticalTypeConstraints.ts] +class Different { + a: number; + b: string; + c: boolean; +} + +class Foo { + n: T; +} +interface Foo { + y: T; +} +interface Qux { + y: T; +} +class Qux { + n: T; +} + +class Bar { + n: T; +} +interface Bar { + y: T; +} +interface Baz { + y: T; +} +class Baz { + n: T; +} + +class Quux { + n: T; +} +interface Quux { + 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; +}()); diff --git a/tests/cases/compiler/nonIdenticalTypeConstraints.ts b/tests/cases/compiler/nonIdenticalTypeConstraints.ts new file mode 100644 index 00000000000..c0271edc91a --- /dev/null +++ b/tests/cases/compiler/nonIdenticalTypeConstraints.ts @@ -0,0 +1,38 @@ +class Different { + a: number; + b: string; + c: boolean; +} + +class Foo { + n: T; +} +interface Foo { + y: T; +} +interface Qux { + y: T; +} +class Qux { + n: T; +} + +class Bar { + n: T; +} +interface Bar { + y: T; +} +interface Baz { + y: T; +} +class Baz { + n: T; +} + +class Quux { + n: T; +} +interface Quux { + m: U; +} \ No newline at end of file