forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not all extended types have symbols (microsoft#20827)
- Loading branch information
Showing
6 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/baselines/reference/implementsIncorrectlyNoAssertion.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
tests/cases/compiler/implementsIncorrectlyNoAssertion.ts(8,7): error TS2420: Class 'Baz' incorrectly implements interface 'Foo & Bar'. | ||
Type 'Baz' is not assignable to type 'Foo'. | ||
Types of property 'x' are incompatible. | ||
Type 'number' is not assignable to type 'string'. | ||
|
||
|
||
==== tests/cases/compiler/implementsIncorrectlyNoAssertion.ts (1 errors) ==== | ||
declare class Foo { | ||
x: string; | ||
} | ||
declare class Bar { | ||
y: string; | ||
} | ||
type Wrapper = Foo & Bar; | ||
class Baz implements Wrapper { | ||
~~~ | ||
!!! error TS2420: Class 'Baz' incorrectly implements interface 'Foo & Bar'. | ||
!!! error TS2420: Type 'Baz' is not assignable to type 'Foo'. | ||
!!! error TS2420: Types of property 'x' are incompatible. | ||
!!! error TS2420: Type 'number' is not assignable to type 'string'. | ||
x: number; | ||
y: string; | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/implementsIncorrectlyNoAssertion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//// [implementsIncorrectlyNoAssertion.ts] | ||
declare class Foo { | ||
x: string; | ||
} | ||
declare class Bar { | ||
y: string; | ||
} | ||
type Wrapper = Foo & Bar; | ||
class Baz implements Wrapper { | ||
x: number; | ||
y: string; | ||
} | ||
|
||
|
||
//// [implementsIncorrectlyNoAssertion.js] | ||
var Baz = /** @class */ (function () { | ||
function Baz() { | ||
} | ||
return Baz; | ||
}()); |
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/implementsIncorrectlyNoAssertion.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
=== tests/cases/compiler/implementsIncorrectlyNoAssertion.ts === | ||
declare class Foo { | ||
>Foo : Symbol(Foo, Decl(implementsIncorrectlyNoAssertion.ts, 0, 0)) | ||
|
||
x: string; | ||
>x : Symbol(Foo.x, Decl(implementsIncorrectlyNoAssertion.ts, 0, 19)) | ||
} | ||
declare class Bar { | ||
>Bar : Symbol(Bar, Decl(implementsIncorrectlyNoAssertion.ts, 2, 1)) | ||
|
||
y: string; | ||
>y : Symbol(Bar.y, Decl(implementsIncorrectlyNoAssertion.ts, 3, 19)) | ||
} | ||
type Wrapper = Foo & Bar; | ||
>Wrapper : Symbol(Wrapper, Decl(implementsIncorrectlyNoAssertion.ts, 5, 1)) | ||
>Foo : Symbol(Foo, Decl(implementsIncorrectlyNoAssertion.ts, 0, 0)) | ||
>Bar : Symbol(Bar, Decl(implementsIncorrectlyNoAssertion.ts, 2, 1)) | ||
|
||
class Baz implements Wrapper { | ||
>Baz : Symbol(Baz, Decl(implementsIncorrectlyNoAssertion.ts, 6, 25)) | ||
>Wrapper : Symbol(Wrapper, Decl(implementsIncorrectlyNoAssertion.ts, 5, 1)) | ||
|
||
x: number; | ||
>x : Symbol(Baz.x, Decl(implementsIncorrectlyNoAssertion.ts, 7, 30)) | ||
|
||
y: string; | ||
>y : Symbol(Baz.y, Decl(implementsIncorrectlyNoAssertion.ts, 8, 14)) | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/implementsIncorrectlyNoAssertion.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
=== tests/cases/compiler/implementsIncorrectlyNoAssertion.ts === | ||
declare class Foo { | ||
>Foo : Foo | ||
|
||
x: string; | ||
>x : string | ||
} | ||
declare class Bar { | ||
>Bar : Bar | ||
|
||
y: string; | ||
>y : string | ||
} | ||
type Wrapper = Foo & Bar; | ||
>Wrapper : Wrapper | ||
>Foo : Foo | ||
>Bar : Bar | ||
|
||
class Baz implements Wrapper { | ||
>Baz : Baz | ||
>Wrapper : Wrapper | ||
|
||
x: number; | ||
>x : number | ||
|
||
y: string; | ||
>y : string | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
declare class Foo { | ||
x: string; | ||
} | ||
declare class Bar { | ||
y: string; | ||
} | ||
type Wrapper = Foo & Bar; | ||
class Baz implements Wrapper { | ||
x: number; | ||
y: string; | ||
} |