mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
duplicateIdentifierDifferentModifiers.ts(2,15): error TS2687: All declarations of 'x' must have identical modifiers.
|
|
duplicateIdentifierDifferentModifiers.ts(3,15): error TS2687: All declarations of 'x' must have identical modifiers.
|
|
duplicateIdentifierDifferentModifiers.ts(16,11): error TS2687: All declarations of 'y' must have identical modifiers.
|
|
duplicateIdentifierDifferentModifiers.ts(20,3): error TS2687: All declarations of 'y' must have identical modifiers.
|
|
|
|
|
|
==== duplicateIdentifierDifferentModifiers.ts (4 errors) ====
|
|
// Not OK
|
|
interface B { x; }
|
|
~
|
|
!!! error TS2687: All declarations of 'x' must have identical modifiers.
|
|
interface B { x?; }
|
|
~
|
|
!!! error TS2687: All declarations of 'x' must have identical modifiers.
|
|
|
|
// OK
|
|
class A {
|
|
public y: string;
|
|
}
|
|
|
|
interface A {
|
|
y: string;
|
|
}
|
|
|
|
// Not OK
|
|
class C {
|
|
private y: string;
|
|
~
|
|
!!! error TS2687: All declarations of 'y' must have identical modifiers.
|
|
}
|
|
|
|
interface C {
|
|
y: string;
|
|
~
|
|
!!! error TS2687: All declarations of 'y' must have identical modifiers.
|
|
}
|
|
|