forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
- Loading branch information
1 parent
e1bb300
commit dc1ffe9
Showing
12 changed files
with
548 additions
and
81 deletions.
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
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
2 changes: 1 addition & 1 deletion
2
...isolated-declarations/auto-fixed/diff/isolatedDeclarationErrorsExpandoFunctions.d.ts.diff
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
45 changes: 45 additions & 0 deletions
45
.../reference/isolated-declarations/auto-fixed/diff/isolatedDeclarationLazySymbols.d.ts.diff
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,45 @@ | ||
// [[Reason: Expando function declarations are not fixed.]] //// | ||
|
||
//// [tests/cases/compiler/isolatedDeclarationLazySymbols.ts] //// | ||
|
||
=================================================================== | ||
--- TSC declarations | ||
+++ DTE declarations | ||
@@ -1,11 +1,8 @@ | ||
|
||
|
||
//// [isolatedDeclarationLazySymbols.d.ts] | ||
export declare function foo(): void; | ||
-export declare namespace foo { | ||
- var b: string; | ||
-} | ||
declare const o: { | ||
readonly "prop.inner": "a"; | ||
readonly prop: { | ||
readonly inner: "b"; | ||
@@ -20,12 +17,13 @@ | ||
export {}; | ||
//# sourceMappingURL=isolatedDeclarationLazySymbols.d.ts.map | ||
/// [Errors] //// | ||
|
||
+isolatedDeclarationLazySymbols.ts(13,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationLazySymbols.ts(16,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. | ||
|
||
|
||
-==== isolatedDeclarationLazySymbols.ts (1 errors) ==== | ||
+==== isolatedDeclarationLazySymbols.ts (2 errors) ==== | ||
export function foo(): void { | ||
|
||
} | ||
|
||
@@ -37,8 +35,10 @@ | ||
} as const | ||
|
||
foo[o["prop.inner"]] ="A"; | ||
foo[o.prop.inner] = "B"; | ||
+ ~~~~~~~~~~~~~~~~~ | ||
+!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
|
||
export class Foo { | ||
[o["prop.inner"]] ="A" | ||
~~~~~~~~~~~~~~~~~ |
87 changes: 87 additions & 0 deletions
87
...elines/reference/isolated-declarations/auto-fixed/dte/isolatedDeclarationLazySymbols.d.ts
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,87 @@ | ||
//// [tests/cases/compiler/isolatedDeclarationLazySymbols.ts] //// | ||
|
||
//// [isolatedDeclarationLazySymbols.ts] | ||
export function foo(): void { | ||
|
||
} | ||
|
||
const o = { | ||
["prop.inner"]: "a", | ||
prop: { | ||
inner: "b", | ||
} | ||
} as const | ||
|
||
foo[o["prop.inner"]] ="A"; | ||
foo[o.prop.inner] = "B"; | ||
|
||
export class Foo { | ||
[o["prop.inner"]] ="A" | ||
[o.prop.inner] = "B" | ||
} | ||
|
||
export let oo: { | ||
a: string; | ||
[o.prop.inner]: string; | ||
} = { | ||
[o['prop.inner']]:"A", | ||
[o.prop.inner]: "B", | ||
} | ||
|
||
/// [Declarations] //// | ||
|
||
|
||
|
||
//// [isolatedDeclarationLazySymbols.d.ts] | ||
export declare function foo(): void; | ||
declare const o: { | ||
readonly "prop.inner": "a"; | ||
readonly prop: { | ||
readonly inner: "b"; | ||
}; | ||
}; | ||
export declare class Foo { | ||
} | ||
export declare let oo: { | ||
a: string; | ||
[o.prop.inner]: string; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=isolatedDeclarationLazySymbols.d.ts.map | ||
/// [Errors] //// | ||
|
||
isolatedDeclarationLazySymbols.ts(13,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
isolatedDeclarationLazySymbols.ts(16,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. | ||
|
||
|
||
==== isolatedDeclarationLazySymbols.ts (2 errors) ==== | ||
export function foo(): void { | ||
|
||
} | ||
|
||
const o = { | ||
["prop.inner"]: "a", | ||
prop: { | ||
inner: "b", | ||
} | ||
} as const | ||
|
||
foo[o["prop.inner"]] ="A"; | ||
foo[o.prop.inner] = "B"; | ||
~~~~~~~~~~~~~~~~~ | ||
!!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. | ||
|
||
export class Foo { | ||
[o["prop.inner"]] ="A" | ||
~~~~~~~~~~~~~~~~~ | ||
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. | ||
[o.prop.inner] = "B" | ||
} | ||
|
||
export let oo: { | ||
a: string; | ||
[o.prop.inner]: string; | ||
} = { | ||
[o['prop.inner']]:"A", | ||
[o.prop.inner]: "B", | ||
} |
Oops, something went wrong.