mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Fix namespace expando merge (#26690)
* Allow JSContainers to merge with namespaces Expando functions marked with JSContainer previously failed to merge with namespaces. This change adds JSContainer to ValueModuleExcludes, allowing this kind of merge. * Improve symbol flags to fix namespace/expando merging Calls to bindPropertyAssignment now provide which special assignment kind they originated from. This allows better symbol flags to be set: 1. Property assignments get the FunctionScopedVariable flag, since they are equivalent to a `namespace` exporting a `var`. 2. Prototype property assignments get the Method flag if the initialiser is functionlike, and Property otherwise. 3. Prototype assignments get the flag Property. (3) is still not entirely correct (it's missing the Prototype flag), but is what existed previously. I'll try adding the Prototype flag to see whether it changes any baselines. * Add cross-file merge test * Update missed baselines * Namespace declarations are primary for merging purposes Also, property-assignments go back to being property declarations, not function-scoped variable declarations * Revert unneeded changes * Revert unneeded changes (in a codefix this time) * Put JSContainer on all assignment declarations This allows most of the new special-case merge code to go away. It now uses the JSContainer special-case code, which already exists. * Missed comment * Fix extra newline lint
This commit is contained in:
parent
828279b611
commit
d3f96015f1
@ -236,8 +236,9 @@ namespace ts {
|
||||
if (symbolFlags & SymbolFlags.Value) {
|
||||
const { valueDeclaration } = symbol;
|
||||
if (!valueDeclaration ||
|
||||
(isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) ||
|
||||
(valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration))) {
|
||||
// other kinds of value declarations take precedence over modules
|
||||
// other kinds of value declarations take precedence over modules and assignment declarations
|
||||
symbol.valueDeclaration = node;
|
||||
}
|
||||
}
|
||||
@ -373,7 +374,8 @@ namespace ts {
|
||||
// prototype symbols like methods.
|
||||
symbolTable.set(name, symbol = createSymbol(SymbolFlags.None, name));
|
||||
}
|
||||
else {
|
||||
else if (!(includes & SymbolFlags.Variable && symbol.flags & SymbolFlags.JSContainer)) {
|
||||
// JSContainers are allowed to merge with variables, no matter what other flags they have.
|
||||
if (isNamedDeclaration(node)) {
|
||||
node.name.parent = node;
|
||||
}
|
||||
@ -2537,12 +2539,10 @@ namespace ts {
|
||||
(namespaceSymbol.members || (namespaceSymbol.members = createSymbolTable())) :
|
||||
(namespaceSymbol.exports || (namespaceSymbol.exports = createSymbolTable()));
|
||||
|
||||
// Declare the method/property
|
||||
const jsContainerFlag = isToplevelNamespaceableInitializer ? SymbolFlags.JSContainer : 0;
|
||||
const isMethod = isFunctionLikeDeclaration(getAssignedJavascriptInitializer(propertyAccess)!);
|
||||
const symbolFlags = (isMethod ? SymbolFlags.Method : SymbolFlags.Property) | jsContainerFlag;
|
||||
const symbolExcludes = (isMethod ? SymbolFlags.MethodExcludes : SymbolFlags.PropertyExcludes) & ~jsContainerFlag;
|
||||
declareSymbol(symbolTable, namespaceSymbol, propertyAccess, symbolFlags, symbolExcludes);
|
||||
const includes = isMethod ? SymbolFlags.Method : SymbolFlags.Property;
|
||||
const excludes = isMethod ? SymbolFlags.MethodExcludes : SymbolFlags.PropertyExcludes;
|
||||
declareSymbol(symbolTable, namespaceSymbol, propertyAccess, includes | SymbolFlags.JSContainer, excludes & ~SymbolFlags.JSContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -837,8 +837,9 @@ namespace ts {
|
||||
target.flags |= source.flags;
|
||||
if (source.valueDeclaration &&
|
||||
(!target.valueDeclaration ||
|
||||
isAssignmentDeclaration(target.valueDeclaration) ||
|
||||
isEffectiveModuleDeclaration(target.valueDeclaration) && !isEffectiveModuleDeclaration(source.valueDeclaration))) {
|
||||
// other kinds of value declarations take precedence over modules
|
||||
// other kinds of value declarations take precedence over modules and assignment declarations
|
||||
target.valueDeclaration = source.valueDeclaration;
|
||||
}
|
||||
addRange(target.declarations, source.declarations);
|
||||
|
||||
@ -3463,7 +3463,7 @@ namespace ts {
|
||||
InterfaceExcludes = Type & ~(Interface | Class),
|
||||
RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules
|
||||
ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums
|
||||
ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule),
|
||||
ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule | JSContainer),
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = Value & ~Method,
|
||||
GetAccessorExcludes = Value & ~SetAccessor,
|
||||
|
||||
@ -1762,6 +1762,10 @@ namespace ts {
|
||||
return decl;
|
||||
}
|
||||
|
||||
export function isAssignmentDeclaration(decl: Declaration) {
|
||||
return isBinaryExpression(decl) || isPropertyAccessExpression(decl) || isIdentifier(decl);
|
||||
}
|
||||
|
||||
/** Get the initializer, taking into account defaulted Javascript initializers */
|
||||
export function getEffectiveInitializer(node: HasExpressionInitializer) {
|
||||
if (isInJavaScriptFile(node) && node.initializer &&
|
||||
|
||||
@ -2075,7 +2075,7 @@ declare namespace ts {
|
||||
InterfaceExcludes = 67897736,
|
||||
RegularEnumExcludes = 68008191,
|
||||
ConstEnumExcludes = 68008831,
|
||||
ValueModuleExcludes = 67219599,
|
||||
ValueModuleExcludes = 110735,
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = 67212223,
|
||||
GetAccessorExcludes = 67154879,
|
||||
|
||||
@ -2075,7 +2075,7 @@ declare namespace ts {
|
||||
InterfaceExcludes = 67897736,
|
||||
RegularEnumExcludes = 68008191,
|
||||
ConstEnumExcludes = 68008831,
|
||||
ValueModuleExcludes = 67219599,
|
||||
ValueModuleExcludes = 110735,
|
||||
NamespaceModuleExcludes = 0,
|
||||
MethodExcludes = 67212223,
|
||||
GetAccessorExcludes = 67154879,
|
||||
|
||||
@ -6,18 +6,18 @@ const a = {};
|
||||
|
||||
a.d = function() {};
|
||||
>a.d = function() {} : { (): void; prototype: {}; }
|
||||
>a.d : { (): void; prototype: {}; }
|
||||
>a.d : typeof a.d
|
||||
>a : typeof a
|
||||
>d : { (): void; prototype: {}; }
|
||||
>d : typeof a.d
|
||||
>function() {} : { (): void; prototype: {}; }
|
||||
|
||||
=== tests/cases/conformance/salsa/b.js ===
|
||||
a.d.prototype = {};
|
||||
>a.d.prototype = {} : {}
|
||||
>a.d.prototype : {}
|
||||
>a.d : { (): void; prototype: {}; }
|
||||
>a.d : typeof a.d
|
||||
>a : typeof a
|
||||
>d : { (): void; prototype: {}; }
|
||||
>d : typeof a.d
|
||||
>prototype : {}
|
||||
>{} : {}
|
||||
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts(13,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts(25,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts (2 errors) ====
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
56
tests/baselines/reference/typeFromPropertyAssignment31.js
Normal file
56
tests/baselines/reference/typeFromPropertyAssignment31.js
Normal file
@ -0,0 +1,56 @@
|
||||
//// [typeFromPropertyAssignment31.ts]
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
|
||||
//// [typeFromPropertyAssignment31.js]
|
||||
function ExpandoMerge(n) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111;
|
||||
ExpandoMerge.m = function (n) {
|
||||
return n + 1;
|
||||
};
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p2 = 222;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p3 = 333;
|
||||
ExpandoMerge.p4 = 4;
|
||||
ExpandoMerge.p5 = 5;
|
||||
ExpandoMerge.p6 = 6;
|
||||
ExpandoMerge.p7 = 7;
|
||||
ExpandoMerge.p8 = 6;
|
||||
ExpandoMerge.p9 = 7;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
116
tests/baselines/reference/typeFromPropertyAssignment31.symbols
Normal file
116
tests/baselines/reference/typeFromPropertyAssignment31.symbols
Normal file
@ -0,0 +1,116 @@
|
||||
=== tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>n : Symbol(n, Decl(typeFromPropertyAssignment31.ts, 0, 22))
|
||||
|
||||
return n;
|
||||
>n : Symbol(n, Decl(typeFromPropertyAssignment31.ts, 0, 22))
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(typeFromPropertyAssignment31.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(typeFromPropertyAssignment31.ts, 2, 1))
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(typeFromPropertyAssignment31.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(typeFromPropertyAssignment31.ts, 3, 21))
|
||||
>n : Symbol(n, Decl(typeFromPropertyAssignment31.ts, 4, 26))
|
||||
|
||||
return n + 1;
|
||||
>n : Symbol(n, Decl(typeFromPropertyAssignment31.ts, 4, 26))
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : Symbol(p2, Decl(typeFromPropertyAssignment31.ts, 8, 14))
|
||||
}
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(typeFromPropertyAssignment31.ts, 9, 1), Decl(typeFromPropertyAssignment31.ts, 15, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(typeFromPropertyAssignment31.ts, 9, 1), Decl(typeFromPropertyAssignment31.ts, 15, 14))
|
||||
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(typeFromPropertyAssignment31.ts, 10, 24), Decl(typeFromPropertyAssignment31.ts, 17, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(typeFromPropertyAssignment31.ts, 10, 24), Decl(typeFromPropertyAssignment31.ts, 17, 14))
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(typeFromPropertyAssignment31.ts, 11, 24), Decl(typeFromPropertyAssignment31.ts, 19, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(typeFromPropertyAssignment31.ts, 11, 24), Decl(typeFromPropertyAssignment31.ts, 19, 14))
|
||||
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : Symbol(p3, Decl(typeFromPropertyAssignment31.ts, 14, 14))
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : Symbol(p4, Decl(typeFromPropertyAssignment31.ts, 9, 1), Decl(typeFromPropertyAssignment31.ts, 15, 14))
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : Symbol(p5, Decl(typeFromPropertyAssignment31.ts, 16, 14), Decl(typeFromPropertyAssignment31.ts, 21, 1))
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : Symbol(p6, Decl(typeFromPropertyAssignment31.ts, 10, 24), Decl(typeFromPropertyAssignment31.ts, 17, 14))
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : Symbol(p7, Decl(typeFromPropertyAssignment31.ts, 18, 14), Decl(typeFromPropertyAssignment31.ts, 22, 25))
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : Symbol(p8, Decl(typeFromPropertyAssignment31.ts, 11, 24), Decl(typeFromPropertyAssignment31.ts, 19, 14))
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : Symbol(p9, Decl(typeFromPropertyAssignment31.ts, 20, 14), Decl(typeFromPropertyAssignment31.ts, 23, 25))
|
||||
}
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(typeFromPropertyAssignment31.ts, 16, 14), Decl(typeFromPropertyAssignment31.ts, 21, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(typeFromPropertyAssignment31.ts, 16, 14), Decl(typeFromPropertyAssignment31.ts, 21, 1))
|
||||
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(typeFromPropertyAssignment31.ts, 18, 14), Decl(typeFromPropertyAssignment31.ts, 22, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(typeFromPropertyAssignment31.ts, 18, 14), Decl(typeFromPropertyAssignment31.ts, 22, 25))
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(typeFromPropertyAssignment31.ts, 20, 14), Decl(typeFromPropertyAssignment31.ts, 23, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(typeFromPropertyAssignment31.ts, 20, 14), Decl(typeFromPropertyAssignment31.ts, 23, 25))
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : Symbol(n, Decl(typeFromPropertyAssignment31.ts, 25, 3))
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(typeFromPropertyAssignment31.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(typeFromPropertyAssignment31.ts, 2, 1))
|
||||
>ExpandoMerge.p2 : Symbol(ExpandoMerge.p2, Decl(typeFromPropertyAssignment31.ts, 8, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p2 : Symbol(ExpandoMerge.p2, Decl(typeFromPropertyAssignment31.ts, 8, 14))
|
||||
>ExpandoMerge.p3 : Symbol(ExpandoMerge.p3, Decl(typeFromPropertyAssignment31.ts, 14, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p3 : Symbol(ExpandoMerge.p3, Decl(typeFromPropertyAssignment31.ts, 14, 14))
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(typeFromPropertyAssignment31.ts, 9, 1), Decl(typeFromPropertyAssignment31.ts, 15, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(typeFromPropertyAssignment31.ts, 9, 1), Decl(typeFromPropertyAssignment31.ts, 15, 14))
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(typeFromPropertyAssignment31.ts, 16, 14), Decl(typeFromPropertyAssignment31.ts, 21, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(typeFromPropertyAssignment31.ts, 16, 14), Decl(typeFromPropertyAssignment31.ts, 21, 1))
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(typeFromPropertyAssignment31.ts, 10, 24), Decl(typeFromPropertyAssignment31.ts, 17, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(typeFromPropertyAssignment31.ts, 10, 24), Decl(typeFromPropertyAssignment31.ts, 17, 14))
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(typeFromPropertyAssignment31.ts, 18, 14), Decl(typeFromPropertyAssignment31.ts, 22, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(typeFromPropertyAssignment31.ts, 18, 14), Decl(typeFromPropertyAssignment31.ts, 22, 25))
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(typeFromPropertyAssignment31.ts, 11, 24), Decl(typeFromPropertyAssignment31.ts, 19, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(typeFromPropertyAssignment31.ts, 11, 24), Decl(typeFromPropertyAssignment31.ts, 19, 14))
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(typeFromPropertyAssignment31.ts, 20, 14), Decl(typeFromPropertyAssignment31.ts, 23, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(typeFromPropertyAssignment31.ts, 20, 14), Decl(typeFromPropertyAssignment31.ts, 23, 25))
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(typeFromPropertyAssignment31.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(typeFromPropertyAssignment31.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(typeFromPropertyAssignment31.ts, 0, 0), Decl(typeFromPropertyAssignment31.ts, 3, 21), Decl(typeFromPropertyAssignment31.ts, 6, 1), Decl(typeFromPropertyAssignment31.ts, 12, 24))
|
||||
|
||||
156
tests/baselines/reference/typeFromPropertyAssignment31.types
Normal file
156
tests/baselines/reference/typeFromPropertyAssignment31.types
Normal file
@ -0,0 +1,156 @@
|
||||
=== tests/cases/conformance/salsa/typeFromPropertyAssignment31.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>n : number
|
||||
|
||||
return n;
|
||||
>n : number
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 = 111 : 111
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>111 : 111
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m = function(n: number) { return n + 1;} : (n: number) => number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>function(n: number) { return n + 1;} : (n: number) => number
|
||||
>n : number
|
||||
|
||||
return n + 1;
|
||||
>n + 1 : number
|
||||
>n : number
|
||||
>1 : 1
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : number
|
||||
>222 : 222
|
||||
}
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
>ExpandoMerge.p4 = 44444 : 44444
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>44444 : 44444
|
||||
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
>ExpandoMerge.p6 = 66666 : 66666
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>66666 : 66666
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 = false : false
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>false : false
|
||||
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : number
|
||||
>333 : 333
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : number
|
||||
>4 : 4
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : number
|
||||
>5 : 5
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : number
|
||||
>6 : 6
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : number
|
||||
>7 : 7
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : number
|
||||
>6 : 6
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : number
|
||||
>7 : 7
|
||||
}
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
>ExpandoMerge.p5 = 555555 : 555555
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>555555 : 555555
|
||||
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
>ExpandoMerge.p7 = 777777 : 777777
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>777777 : 777777
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 = false : false
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>false : false
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 : number
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>ExpandoMerge.p2 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p2 : number
|
||||
>ExpandoMerge.p3 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p3 : number
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>12 : 12
|
||||
>ExpandoMerge(1001) : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>1001 : 1001
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
tests/cases/conformance/salsa/expando.ts(12,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
tests/cases/conformance/salsa/expando.ts(13,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
tests/cases/conformance/salsa/ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
tests/cases/conformance/salsa/ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
|
||||
|
||||
==== tests/cases/conformance/salsa/expando.ts (2 errors) ====
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
==== tests/cases/conformance/salsa/ns.ts (2 errors) ====
|
||||
namespace ExpandoMerge {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
export var p2 = 222;
|
||||
}
|
||||
|
||||
62
tests/baselines/reference/typeFromPropertyAssignment32.js
Normal file
62
tests/baselines/reference/typeFromPropertyAssignment32.js
Normal file
@ -0,0 +1,62 @@
|
||||
//// [tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts] ////
|
||||
|
||||
//// [expando.ts]
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
//// [ns.ts]
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
|
||||
|
||||
//// [expando.js]
|
||||
function ExpandoMerge(n) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111;
|
||||
ExpandoMerge.m = function (n) {
|
||||
return n + 1;
|
||||
};
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
//// [ns.js]
|
||||
var ExpandoMerge;
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p3 = 333;
|
||||
ExpandoMerge.p4 = 4;
|
||||
ExpandoMerge.p5 = 5;
|
||||
ExpandoMerge.p6 = 6;
|
||||
ExpandoMerge.p7 = 7;
|
||||
ExpandoMerge.p8 = 6;
|
||||
ExpandoMerge.p9 = 7;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p2 = 222;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
118
tests/baselines/reference/typeFromPropertyAssignment32.symbols
Normal file
118
tests/baselines/reference/typeFromPropertyAssignment32.symbols
Normal file
@ -0,0 +1,118 @@
|
||||
=== tests/cases/conformance/salsa/expando.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>n : Symbol(n, Decl(expando.ts, 0, 22))
|
||||
|
||||
return n;
|
||||
>n : Symbol(n, Decl(expando.ts, 0, 22))
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>n : Symbol(n, Decl(expando.ts, 4, 26))
|
||||
|
||||
return n + 1;
|
||||
>n : Symbol(n, Decl(expando.ts, 4, 26))
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(expando.ts, 6, 1), Decl(ns.ts, 2, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(expando.ts, 6, 1), Decl(ns.ts, 2, 14))
|
||||
|
||||
ExpandoMerge.p5 = 555555;
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(expando.ts, 7, 24), Decl(ns.ts, 3, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(expando.ts, 7, 24), Decl(ns.ts, 3, 14))
|
||||
|
||||
ExpandoMerge.p6 = 66666;
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(expando.ts, 8, 25), Decl(ns.ts, 4, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(expando.ts, 8, 25), Decl(ns.ts, 4, 14))
|
||||
|
||||
ExpandoMerge.p7 = 777777;
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(expando.ts, 9, 24), Decl(ns.ts, 5, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(expando.ts, 9, 24), Decl(ns.ts, 5, 14))
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(expando.ts, 10, 25), Decl(ns.ts, 6, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(expando.ts, 10, 25), Decl(ns.ts, 6, 14))
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(expando.ts, 11, 24), Decl(ns.ts, 7, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(expando.ts, 11, 24), Decl(ns.ts, 7, 14))
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : Symbol(n, Decl(expando.ts, 13, 3))
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge.p2 : Symbol(ExpandoMerge.p2, Decl(ns.ts, 10, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p2 : Symbol(ExpandoMerge.p2, Decl(ns.ts, 10, 14))
|
||||
>ExpandoMerge.p3 : Symbol(ExpandoMerge.p3, Decl(ns.ts, 1, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p3 : Symbol(ExpandoMerge.p3, Decl(ns.ts, 1, 14))
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(expando.ts, 6, 1), Decl(ns.ts, 2, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(expando.ts, 6, 1), Decl(ns.ts, 2, 14))
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(expando.ts, 7, 24), Decl(ns.ts, 3, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(expando.ts, 7, 24), Decl(ns.ts, 3, 14))
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(expando.ts, 8, 25), Decl(ns.ts, 4, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(expando.ts, 8, 25), Decl(ns.ts, 4, 14))
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(expando.ts, 9, 24), Decl(ns.ts, 5, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(expando.ts, 9, 24), Decl(ns.ts, 5, 14))
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(expando.ts, 10, 25), Decl(ns.ts, 6, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(expando.ts, 10, 25), Decl(ns.ts, 6, 14))
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(expando.ts, 11, 24), Decl(ns.ts, 7, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(expando.ts, 11, 24), Decl(ns.ts, 7, 14))
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
|
||||
=== tests/cases/conformance/salsa/ns.ts ===
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : Symbol(p3, Decl(ns.ts, 1, 14))
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : Symbol(p4, Decl(expando.ts, 6, 1), Decl(ns.ts, 2, 14))
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : Symbol(p5, Decl(expando.ts, 7, 24), Decl(ns.ts, 3, 14))
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : Symbol(p6, Decl(expando.ts, 8, 25), Decl(ns.ts, 4, 14))
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : Symbol(p7, Decl(expando.ts, 9, 24), Decl(ns.ts, 5, 14))
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : Symbol(p8, Decl(expando.ts, 10, 25), Decl(ns.ts, 6, 14))
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : Symbol(p9, Decl(expando.ts, 11, 24), Decl(ns.ts, 7, 14))
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21), Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1))
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : Symbol(p2, Decl(ns.ts, 10, 14))
|
||||
}
|
||||
|
||||
158
tests/baselines/reference/typeFromPropertyAssignment32.types
Normal file
158
tests/baselines/reference/typeFromPropertyAssignment32.types
Normal file
@ -0,0 +1,158 @@
|
||||
=== tests/cases/conformance/salsa/expando.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>n : number
|
||||
|
||||
return n;
|
||||
>n : number
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 = 111 : 111
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>111 : 111
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m = function(n: number) { return n + 1;} : (n: number) => number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>function(n: number) { return n + 1;} : (n: number) => number
|
||||
>n : number
|
||||
|
||||
return n + 1;
|
||||
>n + 1 : number
|
||||
>n : number
|
||||
>1 : 1
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
>ExpandoMerge.p4 = 44444 : 44444
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>44444 : 44444
|
||||
|
||||
ExpandoMerge.p5 = 555555;
|
||||
>ExpandoMerge.p5 = 555555 : 555555
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>555555 : 555555
|
||||
|
||||
ExpandoMerge.p6 = 66666;
|
||||
>ExpandoMerge.p6 = 66666 : 66666
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>66666 : 66666
|
||||
|
||||
ExpandoMerge.p7 = 777777;
|
||||
>ExpandoMerge.p7 = 777777 : 777777
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>777777 : 777777
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 = false : false
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>false : false
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 = false : false
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>false : false
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 : number
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>ExpandoMerge.p2 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p2 : number
|
||||
>ExpandoMerge.p3 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p3 : number
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>12 : 12
|
||||
>ExpandoMerge(1001) : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>1001 : 1001
|
||||
|
||||
=== tests/cases/conformance/salsa/ns.ts ===
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : number
|
||||
>333 : 333
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : number
|
||||
>4 : 4
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : number
|
||||
>5 : 5
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : number
|
||||
>6 : 6
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : number
|
||||
>7 : 7
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : number
|
||||
>6 : 6
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : number
|
||||
>7 : 7
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : number
|
||||
>222 : 222
|
||||
}
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/salsa/expando.ts(12,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
tests/cases/conformance/salsa/expando.ts(13,1): error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
tests/cases/conformance/salsa/ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
tests/cases/conformance/salsa/ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
|
||||
|
||||
==== tests/cases/conformance/salsa/ns.ts (2 errors) ====
|
||||
namespace ExpandoMerge {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
|
||||
export var p2 = 222;
|
||||
}
|
||||
|
||||
|
||||
==== tests/cases/conformance/salsa/expando.ts (2 errors) ====
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'false' is not assignable to type 'number'.
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
|
||||
64
tests/baselines/reference/typeFromPropertyAssignment33.js
Normal file
64
tests/baselines/reference/typeFromPropertyAssignment33.js
Normal file
@ -0,0 +1,64 @@
|
||||
//// [tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts] ////
|
||||
|
||||
//// [ns.ts]
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
|
||||
|
||||
//// [expando.ts]
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
|
||||
|
||||
//// [ns.js]
|
||||
var ExpandoMerge;
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p3 = 333;
|
||||
ExpandoMerge.p4 = 4;
|
||||
ExpandoMerge.p5 = 5;
|
||||
ExpandoMerge.p6 = 6;
|
||||
ExpandoMerge.p7 = 7;
|
||||
ExpandoMerge.p8 = 6;
|
||||
ExpandoMerge.p9 = 7;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
(function (ExpandoMerge) {
|
||||
ExpandoMerge.p2 = 222;
|
||||
})(ExpandoMerge || (ExpandoMerge = {}));
|
||||
//// [expando.js]
|
||||
function ExpandoMerge(n) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111;
|
||||
ExpandoMerge.m = function (n) {
|
||||
return n + 1;
|
||||
};
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
120
tests/baselines/reference/typeFromPropertyAssignment33.symbols
Normal file
120
tests/baselines/reference/typeFromPropertyAssignment33.symbols
Normal file
@ -0,0 +1,120 @@
|
||||
=== tests/cases/conformance/salsa/ns.ts ===
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : Symbol(p3, Decl(ns.ts, 1, 14))
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : Symbol(p4, Decl(ns.ts, 2, 14), Decl(expando.ts, 6, 1))
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : Symbol(p5, Decl(ns.ts, 3, 14), Decl(expando.ts, 7, 24))
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : Symbol(p6, Decl(ns.ts, 4, 14), Decl(expando.ts, 8, 25))
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : Symbol(p7, Decl(ns.ts, 5, 14), Decl(expando.ts, 9, 24))
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : Symbol(p8, Decl(ns.ts, 6, 14), Decl(expando.ts, 10, 25))
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : Symbol(p9, Decl(ns.ts, 7, 14), Decl(expando.ts, 11, 24))
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : Symbol(p2, Decl(ns.ts, 10, 14))
|
||||
}
|
||||
|
||||
|
||||
=== tests/cases/conformance/salsa/expando.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>n : Symbol(n, Decl(expando.ts, 0, 22))
|
||||
|
||||
return n;
|
||||
>n : Symbol(n, Decl(expando.ts, 0, 22))
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>n : Symbol(n, Decl(expando.ts, 4, 26))
|
||||
|
||||
return n + 1;
|
||||
>n : Symbol(n, Decl(expando.ts, 4, 26))
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(ns.ts, 2, 14), Decl(expando.ts, 6, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(ns.ts, 2, 14), Decl(expando.ts, 6, 1))
|
||||
|
||||
ExpandoMerge.p5 = 555555;
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(ns.ts, 3, 14), Decl(expando.ts, 7, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(ns.ts, 3, 14), Decl(expando.ts, 7, 24))
|
||||
|
||||
ExpandoMerge.p6 = 66666;
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(ns.ts, 4, 14), Decl(expando.ts, 8, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(ns.ts, 4, 14), Decl(expando.ts, 8, 25))
|
||||
|
||||
ExpandoMerge.p7 = 777777;
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(ns.ts, 5, 14), Decl(expando.ts, 9, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(ns.ts, 5, 14), Decl(expando.ts, 9, 24))
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(ns.ts, 6, 14), Decl(expando.ts, 10, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(ns.ts, 6, 14), Decl(expando.ts, 10, 25))
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(ns.ts, 7, 14), Decl(expando.ts, 11, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(ns.ts, 7, 14), Decl(expando.ts, 11, 24))
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : Symbol(n, Decl(expando.ts, 13, 3))
|
||||
>ExpandoMerge.p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p1 : Symbol(ExpandoMerge.p1, Decl(expando.ts, 2, 1))
|
||||
>ExpandoMerge.p2 : Symbol(ExpandoMerge.p2, Decl(ns.ts, 10, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p2 : Symbol(ExpandoMerge.p2, Decl(ns.ts, 10, 14))
|
||||
>ExpandoMerge.p3 : Symbol(ExpandoMerge.p3, Decl(ns.ts, 1, 14))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p3 : Symbol(ExpandoMerge.p3, Decl(ns.ts, 1, 14))
|
||||
>ExpandoMerge.p4 : Symbol(ExpandoMerge.p4, Decl(ns.ts, 2, 14), Decl(expando.ts, 6, 1))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p4 : Symbol(ExpandoMerge.p4, Decl(ns.ts, 2, 14), Decl(expando.ts, 6, 1))
|
||||
>ExpandoMerge.p5 : Symbol(ExpandoMerge.p5, Decl(ns.ts, 3, 14), Decl(expando.ts, 7, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p5 : Symbol(ExpandoMerge.p5, Decl(ns.ts, 3, 14), Decl(expando.ts, 7, 24))
|
||||
>ExpandoMerge.p6 : Symbol(ExpandoMerge.p6, Decl(ns.ts, 4, 14), Decl(expando.ts, 8, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p6 : Symbol(ExpandoMerge.p6, Decl(ns.ts, 4, 14), Decl(expando.ts, 8, 25))
|
||||
>ExpandoMerge.p7 : Symbol(ExpandoMerge.p7, Decl(ns.ts, 5, 14), Decl(expando.ts, 9, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p7 : Symbol(ExpandoMerge.p7, Decl(ns.ts, 5, 14), Decl(expando.ts, 9, 24))
|
||||
>ExpandoMerge.p8 : Symbol(ExpandoMerge.p8, Decl(ns.ts, 6, 14), Decl(expando.ts, 10, 25))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p8 : Symbol(ExpandoMerge.p8, Decl(ns.ts, 6, 14), Decl(expando.ts, 10, 25))
|
||||
>ExpandoMerge.p9 : Symbol(ExpandoMerge.p9, Decl(ns.ts, 7, 14), Decl(expando.ts, 11, 24))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>p9 : Symbol(ExpandoMerge.p9, Decl(ns.ts, 7, 14), Decl(expando.ts, 11, 24))
|
||||
>ExpandoMerge.m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
>m : Symbol(ExpandoMerge.m, Decl(expando.ts, 3, 21))
|
||||
>ExpandoMerge : Symbol(ExpandoMerge, Decl(ns.ts, 0, 0), Decl(ns.ts, 8, 1), Decl(expando.ts, 0, 0), Decl(expando.ts, 3, 21))
|
||||
|
||||
|
||||
160
tests/baselines/reference/typeFromPropertyAssignment33.types
Normal file
160
tests/baselines/reference/typeFromPropertyAssignment33.types
Normal file
@ -0,0 +1,160 @@
|
||||
=== tests/cases/conformance/salsa/ns.ts ===
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p3 = 333;
|
||||
>p3 : number
|
||||
>333 : 333
|
||||
|
||||
export var p4 = 4;
|
||||
>p4 : number
|
||||
>4 : 4
|
||||
|
||||
export var p5 = 5;
|
||||
>p5 : number
|
||||
>5 : 5
|
||||
|
||||
export let p6 = 6;
|
||||
>p6 : number
|
||||
>6 : 6
|
||||
|
||||
export let p7 = 7;
|
||||
>p7 : number
|
||||
>7 : 7
|
||||
|
||||
export var p8 = 6;
|
||||
>p8 : number
|
||||
>6 : 6
|
||||
|
||||
export let p9 = 7;
|
||||
>p9 : number
|
||||
>7 : 7
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
|
||||
export var p2 = 222;
|
||||
>p2 : number
|
||||
>222 : 222
|
||||
}
|
||||
|
||||
|
||||
=== tests/cases/conformance/salsa/expando.ts ===
|
||||
function ExpandoMerge(n: number) {
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>n : number
|
||||
|
||||
return n;
|
||||
>n : number
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
>ExpandoMerge.p1 = 111 : 111
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>111 : 111
|
||||
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
>ExpandoMerge.m = function(n: number) { return n + 1;} : (n: number) => number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>function(n: number) { return n + 1;} : (n: number) => number
|
||||
>n : number
|
||||
|
||||
return n + 1;
|
||||
>n + 1 : number
|
||||
>n : number
|
||||
>1 : 1
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
>ExpandoMerge.p4 = 44444 : 44444
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>44444 : 44444
|
||||
|
||||
ExpandoMerge.p5 = 555555;
|
||||
>ExpandoMerge.p5 = 555555 : 555555
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>555555 : 555555
|
||||
|
||||
ExpandoMerge.p6 = 66666;
|
||||
>ExpandoMerge.p6 = 66666 : 66666
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>66666 : 66666
|
||||
|
||||
ExpandoMerge.p7 = 777777;
|
||||
>ExpandoMerge.p7 = 777777 : 777777
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>777777 : 777777
|
||||
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
>ExpandoMerge.p8 = false : false
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>false : false
|
||||
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
>ExpandoMerge.p9 = false : false
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>false : false
|
||||
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
>n : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 : number
|
||||
>ExpandoMerge.p1 + ExpandoMerge.p2 : number
|
||||
>ExpandoMerge.p1 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p1 : number
|
||||
>ExpandoMerge.p2 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p2 : number
|
||||
>ExpandoMerge.p3 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p3 : number
|
||||
>ExpandoMerge.p4 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p4 : number
|
||||
>ExpandoMerge.p5 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p5 : number
|
||||
>ExpandoMerge.p6 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p6 : number
|
||||
>ExpandoMerge.p7 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p7 : number
|
||||
>ExpandoMerge.p8 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p8 : number
|
||||
>ExpandoMerge.p9 : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>p9 : number
|
||||
>ExpandoMerge.m(12) : number
|
||||
>ExpandoMerge.m : (n: number) => number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>m : (n: number) => number
|
||||
>12 : 12
|
||||
>ExpandoMerge(1001) : number
|
||||
>ExpandoMerge : typeof ExpandoMerge
|
||||
>1001 : 1001
|
||||
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444; // ok
|
||||
ExpandoMerge.p6 = 66666; // ok
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
ExpandoMerge.p5 = 555555; // ok
|
||||
ExpandoMerge.p7 = 777777; // ok
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
@ -0,0 +1,29 @@
|
||||
// @Filename: expando.ts
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
// @Filename: ns.ts
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
// @Filename: ns.ts
|
||||
namespace ExpandoMerge {
|
||||
export var p3 = 333;
|
||||
export var p4 = 4;
|
||||
export var p5 = 5;
|
||||
export let p6 = 6;
|
||||
export let p7 = 7;
|
||||
export var p8 = 6;
|
||||
export let p9 = 7;
|
||||
}
|
||||
namespace ExpandoMerge {
|
||||
export var p2 = 222;
|
||||
}
|
||||
|
||||
|
||||
// @Filename: expando.ts
|
||||
function ExpandoMerge(n: number) {
|
||||
return n;
|
||||
}
|
||||
ExpandoMerge.p1 = 111
|
||||
ExpandoMerge.m = function(n: number) {
|
||||
return n + 1;
|
||||
}
|
||||
ExpandoMerge.p4 = 44444;
|
||||
ExpandoMerge.p5 = 555555;
|
||||
ExpandoMerge.p6 = 66666;
|
||||
ExpandoMerge.p7 = 777777;
|
||||
ExpandoMerge.p8 = false; // type error
|
||||
ExpandoMerge.p9 = false; // type error
|
||||
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user