mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
allow use of arguments on ambient context
This commit is contained in:
@@ -221,7 +221,7 @@ namespace ts {
|
||||
// other kinds of value declarations take precedence over modules
|
||||
symbol.valueDeclaration = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Should not be called on a declaration with a computed property name,
|
||||
@@ -389,9 +389,9 @@ namespace ts {
|
||||
// 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default
|
||||
// 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers)
|
||||
if (symbol.declarations && symbol.declarations.length &&
|
||||
(isDefaultExport || (node.kind === SyntaxKind.ExportAssignment && !(<ExportAssignment>node).isExportEquals))) {
|
||||
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
|
||||
}
|
||||
(isDefaultExport || (node.kind === SyntaxKind.ExportAssignment && !(<ExportAssignment>node).isExportEquals))) {
|
||||
message = Diagnostics.A_module_cannot_have_multiple_default_exports;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ namespace ts {
|
||||
if (isObjectLiteralOrClassExpressionMethod(node)) {
|
||||
return ContainerFlags.IsContainer | ContainerFlags.IsControlFlowContainer | ContainerFlags.HasLocals | ContainerFlags.IsFunctionLike | ContainerFlags.IsObjectLiteralOrClassExpressionMethod;
|
||||
}
|
||||
// falls through
|
||||
// falls through
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
@@ -1716,7 +1716,7 @@ namespace ts {
|
||||
declareModuleMember(node, symbolFlags, symbolExcludes);
|
||||
break;
|
||||
}
|
||||
// falls through
|
||||
// falls through
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = createMap<Symbol>();
|
||||
@@ -2010,7 +2010,7 @@ namespace ts {
|
||||
bindBlockScopedDeclaration(<Declaration>parentNode, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
|
||||
break;
|
||||
}
|
||||
// falls through
|
||||
// falls through
|
||||
case SyntaxKind.ThisKeyword:
|
||||
if (currentFlow && (isExpression(node) || parent.kind === SyntaxKind.ShorthandPropertyAssignment)) {
|
||||
node.flowNode = currentFlow;
|
||||
@@ -2186,7 +2186,7 @@ namespace ts {
|
||||
if (!isFunctionLike(node.parent)) {
|
||||
return;
|
||||
}
|
||||
// falls through
|
||||
// falls through
|
||||
case SyntaxKind.ModuleBlock:
|
||||
return updateStrictModeStatementList((<Block | ModuleBlock>node).statements);
|
||||
}
|
||||
@@ -2211,7 +2211,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindSourceFileAsExternalModule() {
|
||||
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName) }"`);
|
||||
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName)}"`);
|
||||
}
|
||||
|
||||
function bindExportAssignment(node: ExportAssignment | BinaryExpression) {
|
||||
@@ -2503,8 +2503,27 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function needParameterStrictModeCheck(node: Node) {
|
||||
if (node.parent.kind === SyntaxKind.ConstructorType || node.parent.kind === SyntaxKind.FunctionType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node.parent.parent && (
|
||||
node.parent.parent.kind === SyntaxKind.InterfaceDeclaration ||
|
||||
node.parent.parent.kind === SyntaxKind.TypeLiteral
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isDeclarationFile(file) || isInAmbientContext(node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function bindParameter(node: ParameterDeclaration) {
|
||||
if (inStrictMode) {
|
||||
if (inStrictMode && needParameterStrictModeCheck(node)) {
|
||||
// It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a
|
||||
// strict mode FunctionLikeDeclaration or FunctionExpression(13.1)
|
||||
checkStrictModeEvalOrArguments(node, node.name);
|
||||
|
||||
@@ -13,9 +13,6 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(30,24): error TS1210:
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(31,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(35,24): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(36,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(41,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(44,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(47,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(51,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(52,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(53,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.
|
||||
@@ -30,15 +27,9 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(67,17): error TS1210:
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(68,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(69,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(70,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(75,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(76,31): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(79,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(80,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(84,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassConstructor.ts(85,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
|
||||
|
||||
==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (38 errors) ====
|
||||
==== tests/cases/compiler/collisionArgumentsClassConstructor.ts (29 errors) ====
|
||||
// Constructors
|
||||
class c1 {
|
||||
constructor(i: number, ...arguments) { // error
|
||||
@@ -110,18 +101,12 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(85,17): error TS1210:
|
||||
|
||||
declare class c4 {
|
||||
constructor(i: number, ...arguments); // No error - no code gen
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
declare class c42 {
|
||||
constructor(arguments: number, ...rest); // No error - no code gen
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
declare class c4NoError {
|
||||
constructor(arguments: number); // no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
|
||||
class c5 {
|
||||
@@ -178,26 +163,14 @@ tests/cases/compiler/collisionArgumentsClassConstructor.ts(85,17): error TS1210:
|
||||
|
||||
declare class c6 {
|
||||
constructor(i: number, ...arguments); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
constructor(i: string, ...arguments); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
declare class c62 {
|
||||
constructor(arguments: number, ...rest); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
constructor(arguments: string, ...rest); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
|
||||
declare class c6NoError {
|
||||
constructor(arguments: number); // no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
constructor(arguments: string); // no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
@@ -20,20 +20,11 @@ tests/cases/compiler/collisionArgumentsClassMethod.ts(21,22): error TS1210: Inva
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(22,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(23,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(24,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(29,30): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(30,17): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(31,23): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(33,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(34,29): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(35,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(36,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(37,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(38,22): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(43,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/collisionArgumentsClassMethod.ts(46,13): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
|
||||
|
||||
==== tests/cases/compiler/collisionArgumentsClassMethod.ts (33 errors) ====
|
||||
==== tests/cases/compiler/collisionArgumentsClassMethod.ts (24 errors) ====
|
||||
class c1 {
|
||||
public foo(i: number, ...arguments) { //arguments is error
|
||||
~~~~~~~~~~~~
|
||||
@@ -107,33 +98,15 @@ tests/cases/compiler/collisionArgumentsClassMethod.ts(46,13): error TS1210: Inva
|
||||
|
||||
declare class c2 {
|
||||
public foo(i: number, ...arguments); // No error - no code gen
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public foo1(arguments: number, ...rest); // No error - no code gen
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public fooNoError(arguments: number); // No error - no code gen
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
|
||||
public f4(i: number, ...arguments); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public f4(i: string, ...arguments); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public f41(arguments: number, ...rest); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public f41(arguments: string, ...rest); // no codegen no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public f4NoError(arguments: number); // no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
public f4NoError(arguments: string); // no error
|
||||
~~~~~~~~~
|
||||
!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode.
|
||||
}
|
||||
|
||||
class c3 {
|
||||
|
||||
@@ -51,9 +51,12 @@ tests/cases/compiler/collisionArgumentsFunction.ts(30,22): error TS2396: Duplica
|
||||
var arguments: any; // No error
|
||||
}
|
||||
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
namespace strict {
|
||||
"use strict";
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
}
|
||||
@@ -37,12 +37,15 @@ function f4NoError(arguments: any) { // no error
|
||||
var arguments: any; // No error
|
||||
}
|
||||
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
namespace strict {
|
||||
"use strict";
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
}
|
||||
|
||||
//// [collisionArgumentsFunction.js]
|
||||
// Functions
|
||||
@@ -90,3 +93,7 @@ function f42(i) {
|
||||
function f4NoError(arguments) {
|
||||
var arguments; // No error
|
||||
}
|
||||
var strict;
|
||||
(function (strict) {
|
||||
"use strict";
|
||||
})(strict || (strict = {}));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [collisionArgumentsInType.ts]
|
||||
"use strict";
|
||||
var v1: (i: number, ...arguments) => void; // no error - no code gen
|
||||
var v12: (arguments: number, ...restParameters) => void; // no error - no code gen
|
||||
var v2: {
|
||||
@@ -15,6 +16,7 @@ var v21: {
|
||||
}
|
||||
|
||||
//// [collisionArgumentsInType.js]
|
||||
"use strict";
|
||||
var v1; // no error - no code gen
|
||||
var v12; // no error - no code gen
|
||||
var v2;
|
||||
|
||||
@@ -1,53 +1,54 @@
|
||||
=== tests/cases/compiler/collisionArgumentsInType.ts ===
|
||||
"use strict";
|
||||
var v1: (i: number, ...arguments) => void; // no error - no code gen
|
||||
>v1 : Symbol(v1, Decl(collisionArgumentsInType.ts, 0, 3))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 0, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 0, 19))
|
||||
>v1 : Symbol(v1, Decl(collisionArgumentsInType.ts, 1, 3))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 1, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 1, 19))
|
||||
|
||||
var v12: (arguments: number, ...restParameters) => void; // no error - no code gen
|
||||
>v12 : Symbol(v12, Decl(collisionArgumentsInType.ts, 1, 3))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 1, 10))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 1, 28))
|
||||
>v12 : Symbol(v12, Decl(collisionArgumentsInType.ts, 2, 3))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 2, 10))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 2, 28))
|
||||
|
||||
var v2: {
|
||||
>v2 : Symbol(v2, Decl(collisionArgumentsInType.ts, 2, 3))
|
||||
>v2 : Symbol(v2, Decl(collisionArgumentsInType.ts, 3, 3))
|
||||
|
||||
(arguments: number, ...restParameters); // no error - no code gen
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 3, 5))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 3, 23))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 4, 5))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 4, 23))
|
||||
|
||||
new (arguments: number, ...restParameters); // no error - no code gen
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 4, 9))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 4, 27))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 5, 9))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 5, 27))
|
||||
|
||||
foo(arguments: number, ...restParameters); // no error - no code gen
|
||||
>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 4, 47))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 5, 8))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 5, 26))
|
||||
>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 5, 47))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 6, 8))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 6, 26))
|
||||
|
||||
prop: (arguments: number, ...restParameters) => void; // no error - no code gen
|
||||
>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 5, 46))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 6, 11))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 6, 29))
|
||||
>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 6, 46))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 7, 11))
|
||||
>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 7, 29))
|
||||
}
|
||||
var v21: {
|
||||
>v21 : Symbol(v21, Decl(collisionArgumentsInType.ts, 8, 3))
|
||||
>v21 : Symbol(v21, Decl(collisionArgumentsInType.ts, 9, 3))
|
||||
|
||||
(i: number, ...arguments); // no error - no code gen
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 9, 5))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 9, 15))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 10, 5))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 10, 15))
|
||||
|
||||
new (i: number, ...arguments); // no error - no code gen
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 10, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 10, 19))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 11, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 11, 19))
|
||||
|
||||
foo(i: number, ...arguments); // no error - no code gen
|
||||
>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 10, 34))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 11, 8))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 11, 18))
|
||||
>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 11, 34))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 12, 8))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 12, 18))
|
||||
|
||||
prop: (i: number, ...arguments) => void; // no error - no code gen
|
||||
>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 11, 33))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 12, 11))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 12, 21))
|
||||
>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 12, 33))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInType.ts, 13, 11))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 13, 21))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
=== tests/cases/compiler/collisionArgumentsInType.ts ===
|
||||
"use strict";
|
||||
>"use strict" : "use strict"
|
||||
|
||||
var v1: (i: number, ...arguments) => void; // no error - no code gen
|
||||
>v1 : (i: number, ...arguments: any[]) => void
|
||||
>i : number
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [collisionArgumentsInterfaceMembers.ts]
|
||||
"use strict";
|
||||
// call
|
||||
interface i1 {
|
||||
(i: number, ...arguments); // no error - no code gen
|
||||
@@ -29,3 +30,4 @@ interface i3 {
|
||||
}
|
||||
|
||||
//// [collisionArgumentsInterfaceMembers.js]
|
||||
"use strict";
|
||||
|
||||
@@ -1,63 +1,64 @@
|
||||
=== tests/cases/compiler/collisionArgumentsInterfaceMembers.ts ===
|
||||
"use strict";
|
||||
// call
|
||||
interface i1 {
|
||||
>i1 : Symbol(i1, Decl(collisionArgumentsInterfaceMembers.ts, 0, 0))
|
||||
>i1 : Symbol(i1, Decl(collisionArgumentsInterfaceMembers.ts, 0, 13))
|
||||
|
||||
(i: number, ...arguments); // no error - no code gen
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 2, 5))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 2, 15))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 3, 5))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 3, 15))
|
||||
}
|
||||
interface i12 {
|
||||
>i12 : Symbol(i12, Decl(collisionArgumentsInterfaceMembers.ts, 3, 1))
|
||||
>i12 : Symbol(i12, Decl(collisionArgumentsInterfaceMembers.ts, 4, 1))
|
||||
|
||||
(arguments: number, ...rest); // no error - no code gen
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 5, 5))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 5, 23))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 6, 5))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 6, 23))
|
||||
}
|
||||
interface i1NoError {
|
||||
>i1NoError : Symbol(i1NoError, Decl(collisionArgumentsInterfaceMembers.ts, 6, 1))
|
||||
>i1NoError : Symbol(i1NoError, Decl(collisionArgumentsInterfaceMembers.ts, 7, 1))
|
||||
|
||||
(arguments: number); // no error
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 8, 5))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 9, 5))
|
||||
}
|
||||
|
||||
// new
|
||||
interface i2 {
|
||||
>i2 : Symbol(i2, Decl(collisionArgumentsInterfaceMembers.ts, 9, 1))
|
||||
>i2 : Symbol(i2, Decl(collisionArgumentsInterfaceMembers.ts, 10, 1))
|
||||
|
||||
new (i: number, ...arguments); // no error - no code gen
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 13, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 13, 19))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 14, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 14, 19))
|
||||
}
|
||||
interface i21 {
|
||||
>i21 : Symbol(i21, Decl(collisionArgumentsInterfaceMembers.ts, 14, 1))
|
||||
>i21 : Symbol(i21, Decl(collisionArgumentsInterfaceMembers.ts, 15, 1))
|
||||
|
||||
new (arguments: number, ...rest); // no error - no code gen
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 16, 9))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 16, 27))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 17, 9))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 17, 27))
|
||||
}
|
||||
interface i2NoError {
|
||||
>i2NoError : Symbol(i2NoError, Decl(collisionArgumentsInterfaceMembers.ts, 17, 1))
|
||||
>i2NoError : Symbol(i2NoError, Decl(collisionArgumentsInterfaceMembers.ts, 18, 1))
|
||||
|
||||
new (arguments: number); // no error
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 19, 9))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 20, 9))
|
||||
}
|
||||
|
||||
// method
|
||||
interface i3 {
|
||||
>i3 : Symbol(i3, Decl(collisionArgumentsInterfaceMembers.ts, 20, 1))
|
||||
>i3 : Symbol(i3, Decl(collisionArgumentsInterfaceMembers.ts, 21, 1))
|
||||
|
||||
foo(i: number, ...arguments); // no error - no code gen
|
||||
>foo : Symbol(i3.foo, Decl(collisionArgumentsInterfaceMembers.ts, 23, 14))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 24, 8))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 24, 18))
|
||||
>foo : Symbol(i3.foo, Decl(collisionArgumentsInterfaceMembers.ts, 24, 14))
|
||||
>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 25, 8))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 25, 18))
|
||||
|
||||
foo1(arguments: number, ...rest); // no error - no code gen
|
||||
>foo1 : Symbol(i3.foo1, Decl(collisionArgumentsInterfaceMembers.ts, 24, 33))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 25, 9))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 25, 27))
|
||||
>foo1 : Symbol(i3.foo1, Decl(collisionArgumentsInterfaceMembers.ts, 25, 33))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 26, 9))
|
||||
>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 26, 27))
|
||||
|
||||
fooNoError(arguments: number); // no error
|
||||
>fooNoError : Symbol(i3.fooNoError, Decl(collisionArgumentsInterfaceMembers.ts, 25, 37))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 26, 15))
|
||||
>fooNoError : Symbol(i3.fooNoError, Decl(collisionArgumentsInterfaceMembers.ts, 26, 37))
|
||||
>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 27, 15))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
=== tests/cases/compiler/collisionArgumentsInterfaceMembers.ts ===
|
||||
"use strict";
|
||||
>"use strict" : "use strict"
|
||||
|
||||
// call
|
||||
interface i1 {
|
||||
>i1 : i1
|
||||
|
||||
@@ -36,9 +36,12 @@ function f4NoError(arguments: any) { // no error
|
||||
var arguments: any; // No error
|
||||
}
|
||||
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
namespace strict {
|
||||
"use strict";
|
||||
declare function f5(arguments: number, ...rest); // no codegen no error
|
||||
declare function f5(arguments: string, ...rest); // no codegen no error
|
||||
declare function f52(i: number, ...arguments); // no codegen no error
|
||||
declare function f52(i: string, ...arguments); // no codegen no error
|
||||
declare function f6(arguments: number); // no codegen no error
|
||||
declare function f6(arguments: string); // no codegen no error
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
"use strict";
|
||||
var v1: (i: number, ...arguments) => void; // no error - no code gen
|
||||
var v12: (arguments: number, ...restParameters) => void; // no error - no code gen
|
||||
var v2: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
"use strict";
|
||||
// call
|
||||
interface i1 {
|
||||
(i: number, ...arguments); // no error - no code gen
|
||||
|
||||
Reference in New Issue
Block a user