diff --git a/internal/ast/ast.go b/internal/ast/ast.go index 37c45c27e7..b1f2094cec 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -368,7 +368,7 @@ func (n *Node) Expression() *Node { case KindJsxSpreadAttribute: return n.AsJsxSpreadAttribute().Expression } - panic("Unhandled case in Node.Expression") + panic("Unhandled case in Node.Expression: " + n.Kind.String()) } func (n *Node) ArgumentList() *NodeList { @@ -378,7 +378,7 @@ func (n *Node) ArgumentList() *NodeList { case KindNewExpression: return n.AsNewExpression().Arguments } - panic("Unhandled case in Node.Arguments") + panic("Unhandled case in Node.Arguments: " + n.Kind.String()) } func (n *Node) Arguments() []*Node { diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index 8df59ec51d..f16594ac2b 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -1427,17 +1427,18 @@ func GetAssignmentDeclarationKind(bin *BinaryExpression) JSDeclarationKind { if bin.OperatorToken.Kind != KindEqualsToken || !IsAccessExpression(bin.Left) { return JSDeclarationKindNone } - if IsModuleExportsAccessExpression(bin.Left) { + if IsInJSFile(bin.Left) && IsModuleExportsAccessExpression(bin.Left) { return JSDeclarationKindModuleExports - } else if (IsModuleExportsAccessExpression(bin.Left.Expression()) || IsExportsIdentifier(bin.Left.Expression())) && + } else if IsInJSFile(bin.Left) && + (IsModuleExportsAccessExpression(bin.Left.Expression()) || IsExportsIdentifier(bin.Left.Expression())) && GetElementOrPropertyAccessName(bin.Left) != nil { return JSDeclarationKindExportsProperty } - if bin.Left.Expression().Kind == KindThisKeyword { + if IsInJSFile(bin.Left) && bin.Left.Expression().Kind == KindThisKeyword { return JSDeclarationKindThisProperty } - if bin.Left.Kind == KindPropertyAccessExpression && IsIdentifier(bin.Left.Expression()) && IsIdentifier(bin.Left.Name()) || - bin.Left.Kind == KindElementAccessExpression && IsIdentifier(bin.Left.Expression()) { + if bin.Left.Kind == KindPropertyAccessExpression && IsEntityNameExpressionEx(bin.Left.Expression(), IsInJSFile(bin.Left)) && IsIdentifier(bin.Left.Name()) || + bin.Left.Kind == KindElementAccessExpression && IsEntityNameExpressionEx(bin.Left.Expression(), IsInJSFile(bin.Left)) { return JSDeclarationKindProperty } return JSDeclarationKindNone @@ -1470,13 +1471,33 @@ func IsDynamicName(name *Node) bool { } func IsEntityNameExpression(node *Node) bool { - return node.Kind == KindIdentifier || IsPropertyAccessEntityNameExpression(node) + return IsEntityNameExpressionEx(node, false /*allowJS*/) } -func IsPropertyAccessEntityNameExpression(node *Node) bool { +func IsEntityNameExpressionEx(node *Node, allowJS bool) bool { + if node.Kind == KindIdentifier || IsPropertyAccessEntityNameExpression(node, allowJS) { + return true + } + if allowJS { + return node.Kind == KindThisKeyword || isElementAccessEntityNameExpression(node, allowJS) + } + return false +} + +func IsPropertyAccessEntityNameExpression(node *Node, allowJS bool) bool { if node.Kind == KindPropertyAccessExpression { expr := node.AsPropertyAccessExpression() - return expr.Name().Kind == KindIdentifier && IsEntityNameExpression(expr.Expression) + return expr.Name().Kind == KindIdentifier && IsEntityNameExpressionEx(expr.Expression, allowJS) + } + return false +} + +func isElementAccessEntityNameExpression(node *Node, allowJS bool) bool { + if node.Kind == KindElementAccessExpression { + expr := node.AsElementAccessExpression() + if IsStringOrNumericLiteralLike(SkipParentheses(expr.ArgumentExpression)) { + return IsEntityNameExpressionEx(expr.Expression, allowJS) + } } return false } diff --git a/internal/binder/binder.go b/internal/binder/binder.go index 5e3dcdbcda..779579d4e1 100644 --- a/internal/binder/binder.go +++ b/internal/binder/binder.go @@ -36,6 +36,7 @@ const ( ContainerFlagsHasLocals ContainerFlags = 1 << 5 ContainerFlagsIsInterface ContainerFlags = 1 << 6 ContainerFlagsIsObjectLiteralOrClassExpressionMethodOrAccessor ContainerFlags = 1 << 7 + ContainerFlagsIsThisContainer ContainerFlags = 1 << 8 ) type Binder struct { @@ -48,7 +49,7 @@ type Binder struct { parent *ast.Node container *ast.Node - thisParentContainer *ast.Node + thisContainer *ast.Node blockScopeContainer *ast.Node lastContainer *ast.Node currentFlow *ast.FlowNode @@ -626,7 +627,7 @@ func (b *Binder) bind(node *ast.Node) bool { case ast.KindBinaryExpression: switch ast.GetAssignmentDeclarationKind(node.AsBinaryExpression()) { case ast.JSDeclarationKindProperty: - b.bindFunctionPropertyAssignment(node) + b.bindExpandoPropertyAssignment(node) case ast.JSDeclarationKindThisProperty: b.bindThisPropertyAssignment(node) } @@ -1012,39 +1013,63 @@ func addLateBoundAssignmentDeclarationToSymbol(node *ast.Node, symbol *ast.Symbo symbol.AssignmentDeclarationMembers.Add(node) } -func (b *Binder) bindFunctionPropertyAssignment(node *ast.Node) { +func (b *Binder) bindExpandoPropertyAssignment(node *ast.Node) { expr := node.AsBinaryExpression() - parentName := expr.Left.Expression().Text() - symbol := b.lookupName(parentName, b.blockScopeContainer) + parent := expr.Left.Expression() + symbol := b.lookupEntity(parent, b.blockScopeContainer) if symbol == nil { - symbol = b.lookupName(parentName, b.container) + symbol = b.lookupEntity(parent, b.container) } - if symbol != nil && symbol.ValueDeclaration != nil { - // For an assignment 'fn.xxx = ...', where 'fn' is a previously declared function or a previously - // declared const variable initialized with a function expression or arrow function, we add expando - // property declarations to the function's symbol. - var funcSymbol *ast.Symbol - switch { - case ast.IsFunctionDeclaration(symbol.ValueDeclaration): - funcSymbol = symbol - case ast.IsVariableDeclaration(symbol.ValueDeclaration) && symbol.ValueDeclaration.Parent.Flags&ast.NodeFlagsConst != 0: - initializer := symbol.ValueDeclaration.Initializer() - if initializer != nil && ast.IsFunctionExpressionOrArrowFunction(initializer) { - funcSymbol = initializer.Symbol() - } + if symbol = getInitializerSymbol(symbol); symbol != nil { + // Fix up parent pointers since we're going to use these nodes before we bind into them + setParent(expr.Left, node) + setParent(expr.Right, node) + if ast.HasDynamicName(node) { + b.bindAnonymousDeclaration(node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.InternalSymbolNameComputed) + addLateBoundAssignmentDeclarationToSymbol(node, symbol) + } else { + b.declareSymbol(ast.GetExports(symbol), symbol, node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsPropertyExcludes) } - if funcSymbol != nil { - // Fix up parent pointers since we're going to use these nodes before we bind into them - setParent(expr.Left, node) - setParent(expr.Right, node) - if ast.HasDynamicName(node) { - b.bindAnonymousDeclaration(node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.InternalSymbolNameComputed) - addLateBoundAssignmentDeclarationToSymbol(node, funcSymbol) - } else { - b.declareSymbol(ast.GetExports(funcSymbol), funcSymbol, node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsPropertyExcludes) - } + } +} + +func getInitializerSymbol(symbol *ast.Symbol) *ast.Symbol { + if symbol == nil || symbol.ValueDeclaration == nil { + return nil + } + declaration := symbol.ValueDeclaration + // For an assignment 'fn.xxx = ...', where 'fn' is a previously declared function or a previously + // declared const variable initialized with a function expression or arrow function, we add expando + // property declarations to the function's symbol. + // This also applies to class expressions and empty object literals. + switch { + case ast.IsFunctionDeclaration(declaration) || ast.IsInJSFile(declaration) && ast.IsClassDeclaration(declaration): + return symbol + case ast.IsVariableDeclaration(declaration) && + (declaration.Parent.Flags&ast.NodeFlagsConst != 0 || ast.IsInJSFile(declaration)): + initializer := declaration.Initializer() + if isExpandoInitializer(initializer) { + return initializer.Symbol() + } + case ast.IsBinaryExpression(declaration) && ast.IsInJSFile(declaration): + initializer := declaration.AsBinaryExpression().Right + if isExpandoInitializer(initializer) { + return initializer.Symbol() } } + return nil +} + +func isExpandoInitializer(initializer *ast.Node) bool { + if initializer == nil { + return false + } + if ast.IsFunctionExpressionOrArrowFunction(initializer) { + return true + } else if ast.IsInJSFile(initializer) { + return ast.IsClassExpression(initializer) || (ast.IsObjectLiteralExpression(initializer) && len(initializer.AsObjectLiteralExpression().Properties.Nodes) == 0) + } + return false } func (b *Binder) bindThisPropertyAssignment(node *ast.Node) { @@ -1052,34 +1077,40 @@ func (b *Binder) bindThisPropertyAssignment(node *ast.Node) { return } bin := node.AsBinaryExpression() - if ast.IsPropertyAccessExpression(bin.Left) && ast.IsPrivateIdentifier(bin.Left.AsPropertyAccessExpression().Name()) { + if ast.IsPropertyAccessExpression(bin.Left) && ast.IsPrivateIdentifier(bin.Left.AsPropertyAccessExpression().Name()) || + b.thisContainer == nil { return } - thisContainer := ast.GetThisContainer(node /*includeArrowFunctions*/, false /*includeClassComputedPropertyName*/, false) - switch thisContainer.Kind { + if classSymbol, symbolTable := b.getThisClassAndSymbolTable(); symbolTable != nil { + if ast.HasDynamicName(node) { + b.declareSymbolEx(symbolTable, classSymbol, node, ast.SymbolFlagsProperty, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, true /*isComputedName*/) + addLateBoundAssignmentDeclarationToSymbol(node, classSymbol) + } else { + b.declareSymbolEx(symbolTable, classSymbol, node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, false /*isComputedName*/) + } + } else if b.thisContainer.Kind != ast.KindFunctionDeclaration && b.thisContainer.Kind != ast.KindFunctionExpression { + // !!! constructor functions + panic("Unhandled case in bindThisPropertyAssignment: " + b.thisContainer.Kind.String()) + } +} + +func (b *Binder) getThisClassAndSymbolTable() (classSymbol *ast.Symbol, symbolTable ast.SymbolTable) { + if b.thisContainer == nil { + return nil, nil + } + switch b.thisContainer.Kind { case ast.KindFunctionDeclaration, ast.KindFunctionExpression: // !!! constructor functions case ast.KindConstructor, ast.KindPropertyDeclaration, ast.KindMethodDeclaration, ast.KindGetAccessor, ast.KindSetAccessor, ast.KindClassStaticBlockDeclaration: // this.property assignment in class member -- bind to the containing class - containingClass := thisContainer.Parent - classSymbol := containingClass.Symbol() - var symbolTable ast.SymbolTable - if ast.IsStatic(thisContainer) { - symbolTable = ast.GetExports(containingClass.Symbol()) + classSymbol = b.thisContainer.Parent.Symbol() + if ast.IsStatic(b.thisContainer) { + symbolTable = ast.GetExports(classSymbol) } else { - symbolTable = ast.GetMembers(containingClass.Symbol()) + symbolTable = ast.GetMembers(classSymbol) } - if ast.HasDynamicName(node) { - b.declareSymbolEx(symbolTable, containingClass.Symbol(), node, ast.SymbolFlagsProperty, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, true /*isComputedName*/) - addLateBoundAssignmentDeclarationToSymbol(node, classSymbol) - } else { - b.declareSymbolEx(symbolTable, containingClass.Symbol(), node, ast.SymbolFlagsProperty|ast.SymbolFlagsAssignment, ast.SymbolFlagsNone, true /*isReplaceableByMethod*/, false /*isComputedName*/) - } - case ast.KindSourceFile, ast.KindModuleDeclaration: - // top-level this.property as assignment to globals is no longer supported - default: - panic("Unhandled case in bindThisPropertyAssignment: " + thisContainer.Kind.String()) } + return classSymbol, symbolTable } func (b *Binder) bindEnumDeclaration(node *ast.Node) { @@ -1211,22 +1242,39 @@ func (b *Binder) bindTypeParameter(node *ast.Node) { } } +func (b *Binder) lookupEntity(node *ast.Node, container *ast.Node) *ast.Symbol { + if ast.IsIdentifier(node) { + return b.lookupName(node.AsIdentifier().Text, container) + } + if ast.IsPropertyAccessExpression(node) && node.AsPropertyAccessExpression().Expression.Kind == ast.KindThisKeyword || + ast.IsElementAccessExpression(node) && node.AsElementAccessExpression().Expression.Kind == ast.KindThisKeyword { + if _, symbolTable := b.getThisClassAndSymbolTable(); symbolTable != nil { + if name := ast.GetElementOrPropertyAccessName(node); name != nil { + return symbolTable[name.Text()] + } + } + return nil + } + if symbol := getInitializerSymbol(b.lookupEntity(node.Expression(), container)); symbol != nil && symbol.Exports != nil { + if name := ast.GetElementOrPropertyAccessName(node); name != nil { + return symbol.Exports[name.Text()] + } + } + return nil +} + func (b *Binder) lookupName(name string, container *ast.Node) *ast.Symbol { - localsContainer := container.LocalsContainerData() - if localsContainer != nil { - local := localsContainer.Locals[name] - if local != nil { + if localsContainer := container.LocalsContainerData(); localsContainer != nil { + if local := localsContainer.Locals[name]; local != nil { return core.OrElse(local.ExportSymbol, local) } } if ast.IsSourceFile(container) { - local := container.AsSourceFile().JSGlobalAugmentations[name] - if local != nil { + if local := container.AsSourceFile().JSGlobalAugmentations[name]; local != nil { return local } } - declaration := container.DeclarationData() - if declaration != nil && declaration.Symbol != nil { + if declaration := container.DeclarationData(); declaration != nil && declaration.Symbol != nil { return declaration.Symbol.Exports[name] } return nil @@ -1438,7 +1486,7 @@ func (b *Binder) bindContainer(node *ast.Node, containerFlags ContainerFlags) { // and block-container. Then after we pop out of processing the children, we restore // these saved values. saveContainer := b.container - saveThisParentContainer := b.thisParentContainer + saveThisContainer := b.thisContainer savedBlockScopeContainer := b.blockScopeContainer // Depending on what kind of node this is, we may have to adjust the current container // and block-container. If the current node is a container, then it is automatically @@ -1458,9 +1506,6 @@ func (b *Binder) bindContainer(node *ast.Node, containerFlags ContainerFlags) { // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if containerFlags&ContainerFlagsIsContainer != 0 { - if node.Kind != ast.KindArrowFunction { - b.thisParentContainer = b.container - } b.container = node b.blockScopeContainer = node if containerFlags&ContainerFlagsHasLocals != 0 { @@ -1472,6 +1517,9 @@ func (b *Binder) bindContainer(node *ast.Node, containerFlags ContainerFlags) { b.blockScopeContainer = node b.addToContainerChain(node) } + if containerFlags&ContainerFlagsIsThisContainer != 0 { + b.thisContainer = node + } if containerFlags&ContainerFlagsIsControlFlowContainer != 0 { saveCurrentFlow := b.currentFlow saveBreakTarget := b.currentBreakTarget @@ -1552,7 +1600,7 @@ func (b *Binder) bindContainer(node *ast.Node, containerFlags ContainerFlags) { b.bindChildren(node) } b.container = saveContainer - b.thisParentContainer = saveThisParentContainer + b.thisContainer = saveThisContainer b.blockScopeContainer = savedBlockScopeContainer } @@ -2572,19 +2620,24 @@ func GetContainerFlags(node *ast.Node) ContainerFlags { return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals case ast.KindGetAccessor, ast.KindSetAccessor, ast.KindMethodDeclaration: if ast.IsObjectLiteralOrClassExpressionMethodOrAccessor(node) { - return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsObjectLiteralOrClassExpressionMethodOrAccessor + return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsObjectLiteralOrClassExpressionMethodOrAccessor | ContainerFlagsIsThisContainer } fallthrough - case ast.KindConstructor, ast.KindFunctionDeclaration, ast.KindMethodSignature, ast.KindCallSignature, ast.KindJSDocSignature, - ast.KindFunctionType, ast.KindConstructSignature, ast.KindConstructorType, ast.KindClassStaticBlockDeclaration: + case ast.KindConstructor, ast.KindClassStaticBlockDeclaration: + return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsThisContainer + case ast.KindMethodSignature, ast.KindCallSignature, ast.KindJSDocSignature, ast.KindFunctionType, ast.KindConstructSignature, ast.KindConstructorType: return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike - case ast.KindFunctionExpression, ast.KindArrowFunction: + case ast.KindFunctionDeclaration: + return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsThisContainer + case ast.KindFunctionExpression: + return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsFunctionExpression | ContainerFlagsIsThisContainer + case ast.KindArrowFunction: return ContainerFlagsIsContainer | ContainerFlagsIsControlFlowContainer | ContainerFlagsHasLocals | ContainerFlagsIsFunctionLike | ContainerFlagsIsFunctionExpression case ast.KindModuleBlock: return ContainerFlagsIsControlFlowContainer case ast.KindPropertyDeclaration: if node.AsPropertyDeclaration().Initializer != nil { - return ContainerFlagsIsControlFlowContainer + return ContainerFlagsIsControlFlowContainer | ContainerFlagsIsThisContainer } else { return ContainerFlagsNone } diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 74fbd0f01a..9f6f06c7bb 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -12492,6 +12492,11 @@ func (c *Checker) checkObjectLiteral(node *ast.Node, checkMode CheckMode) *Type } return result } + // expando object literals have empty properties but filled exports -- skip straight to type creation + if len(node.AsObjectLiteralExpression().Properties.Nodes) == 0 && node.Symbol() != nil && len(node.Symbol().Exports) > 0 { + propertiesTable = node.Symbol().Exports + return createObjectLiteralType() + } for _, memberDecl := range node.AsObjectLiteralExpression().Properties.Nodes { member := c.getSymbolOfDeclaration(memberDecl) var computedNameType *Type @@ -17236,6 +17241,11 @@ func (c *Checker) getWidenedTypeWithContext(t *Type, context *WideningContext) * case t.flags&(TypeFlagsAny|TypeFlagsNullable) != 0: result = c.anyType case isObjectLiteralType(t): + // expando object literal types do not widen to prevent circular checking (but should, ideally) + symbol := t.Symbol() + if symbol != nil && len(symbol.Exports) > 0 && symbol.ValueDeclaration.Kind == ast.KindObjectLiteralExpression && len(symbol.ValueDeclaration.AsObjectLiteralExpression().Properties.Nodes) == 0 { + return t + } result = c.getWidenedTypeOfObjectLiteral(t, context) case t.flags&TypeFlagsUnion != 0: unionContext := context @@ -28015,7 +28025,8 @@ func (c *Checker) getContextualTypeForAssignmentExpression(binary *ast.BinaryExp expr := left.Expression() switch expr.Kind { case ast.KindIdentifier: - if symbol := c.getExportSymbolOfValueSymbolIfExported(c.getResolvedSymbol(expr)); symbol.Flags&ast.SymbolFlagsModuleExports != 0 { + symbol := c.getExportSymbolOfValueSymbolIfExported(c.getResolvedSymbol(expr)) + if symbol.Flags&ast.SymbolFlagsModuleExports != 0 { // No contextual type for an expression of the form 'module.exports = expr'. return nil } @@ -28024,7 +28035,7 @@ func (c *Checker) getContextualTypeForAssignmentExpression(binary *ast.BinaryExp // 'F.id = expr' or 'F[xxx] = expr'. If 'F' is declared as a variable with a type annotation, we can obtain a // contextual type from the annotated type without triggering a circularity. Otherwise, the assignment // declaration has no contextual type. - if symbol := c.getExportSymbolOfValueSymbolIfExported(c.getResolvedSymbol(expr)); symbol.ValueDeclaration != nil && ast.IsVariableDeclaration(symbol.ValueDeclaration) { + if symbol.ValueDeclaration != nil && ast.IsVariableDeclaration(symbol.ValueDeclaration) { if typeNode := symbol.ValueDeclaration.Type(); typeNode != nil { if ast.IsPropertyAccessExpression(left) { return c.getTypeOfPropertyOfContextualType(c.getTypeFromTypeNode(typeNode), left.Name().Text()) @@ -28033,15 +28044,20 @@ func (c *Checker) getContextualTypeForAssignmentExpression(binary *ast.BinaryExp if isTypeUsableAsPropertyName(nameType) { return c.getTypeOfPropertyOfContextualTypeEx(c.getTypeFromTypeNode(typeNode), getPropertyNameFromType(nameType), nameType) } + return c.getTypeOfExpression(left) } } return nil } + case ast.KindPropertyAccessExpression, ast.KindElementAccessExpression: + if binary.Symbol != nil { + return nil + } case ast.KindThisKeyword: var symbol *ast.Symbol + thisType := c.getTypeOfExpression(expr) if ast.IsPropertyAccessExpression(left) { name := left.Name() - thisType := c.getTypeOfExpression(expr) if ast.IsPrivateIdentifier(name) { symbol = c.getPropertyOfType(thisType, binder.GetSymbolNameForPrivateIdentifier(thisType.symbol, name.Text())) } else { @@ -28050,7 +28066,7 @@ func (c *Checker) getContextualTypeForAssignmentExpression(binary *ast.BinaryExp } else { propType := c.checkExpressionCached(left.AsElementAccessExpression().ArgumentExpression) if isTypeUsableAsPropertyName(propType) { - symbol = c.getPropertyOfType(c.getTypeOfExpression(expr), getPropertyNameFromType(propType)) + symbol = c.getPropertyOfType(thisType, getPropertyNameFromType(propType)) } } if symbol != nil { diff --git a/internal/checker/nodebuilderimpl.go b/internal/checker/nodebuilderimpl.go index e4ecddbc2b..009965904c 100644 --- a/internal/checker/nodebuilderimpl.go +++ b/internal/checker/nodebuilderimpl.go @@ -2058,7 +2058,7 @@ func (b *nodeBuilderImpl) addPropertyToElementList(propertySymbol *ast.Symbol, t if b.ch.hasLateBindableName(decl) { if ast.IsBinaryExpression(decl) { name := ast.GetNameOfDeclaration(decl) - if name != nil && ast.IsElementAccessExpression(name) && ast.IsPropertyAccessEntityNameExpression(name.AsElementAccessExpression().ArgumentExpression) { + if name != nil && ast.IsElementAccessExpression(name) && ast.IsPropertyAccessEntityNameExpression(name.AsElementAccessExpression().ArgumentExpression, false /*allowJs*/) { b.trackComputedName(name.AsElementAccessExpression().ArgumentExpression, saveEnclosingDeclaration) } } else { diff --git a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.errors.txt b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.errors.txt deleted file mode 100644 index 577c999705..0000000000 --- a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -index.js(4,3): error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -index.js(9,23): error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? - - -==== index.js (2 errors) ==== - class C { - static blah1 = 123; - } - C.blah2 = 456; - ~~~~~ -!!! error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -!!! related TS2728 index.js:2:10: 'blah1' is declared here. - - class D extends C { - static { - console.log(super.blah1); - console.log(super.blah2); - ~~~~~ -!!! error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -!!! related TS2728 index.js:2:10: 'blah1' is declared here. - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols index 9205e8ce89..07ed4646e4 100644 --- a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols +++ b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols @@ -8,7 +8,9 @@ class C { >blah1 : Symbol(blah1, Decl(index.js, 0, 9)) } C.blah2 = 456; +>C.blah2 : Symbol(blah2, Decl(index.js, 2, 1)) >C : Symbol(C, Decl(index.js, 0, 0)) +>blah2 : Symbol(blah2, Decl(index.js, 2, 1)) class D extends C { >D : Symbol(D, Decl(index.js, 3, 14)) @@ -27,7 +29,9 @@ class D extends C { >console.log : Symbol(log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(log, Decl(lib.dom.d.ts, --, --)) +>super.blah2 : Symbol(blah2, Decl(index.js, 2, 1)) >super : Symbol(C, Decl(index.js, 0, 0)) +>blah2 : Symbol(blah2, Decl(index.js, 2, 1)) } } diff --git a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols.diff b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols.diff index df72d2088f..04fb511fad 100644 --- a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.symbols.diff @@ -15,7 +15,9 @@ ->C.blah2 : Symbol(C.blah2, Decl(index.js, 2, 1)) ->C : Symbol(C, Decl(index.js, 0, 0), Decl(index.js, 2, 1)) ->blah2 : Symbol(C.blah2, Decl(index.js, 2, 1)) ++>C.blah2 : Symbol(blah2, Decl(index.js, 2, 1)) +>C : Symbol(C, Decl(index.js, 0, 0)) ++>blah2 : Symbol(blah2, Decl(index.js, 2, 1)) class D extends C { >D : Symbol(D, Decl(index.js, 3, 14)) @@ -45,6 +47,8 @@ ->super : Symbol(C, Decl(index.js, 0, 0), Decl(index.js, 2, 1)) ->blah2 : Symbol(C.blah2, Decl(index.js, 2, 1)) +>log : Symbol(log, Decl(lib.dom.d.ts, --, --)) ++>super.blah2 : Symbol(blah2, Decl(index.js, 2, 1)) +>super : Symbol(C, Decl(index.js, 0, 0)) ++>blah2 : Symbol(blah2, Decl(index.js, 2, 1)) } } diff --git a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.types b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.types index 356d066e8a..72353b280f 100644 --- a/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.types +++ b/testdata/baselines/reference/submodule/compiler/classFieldSuperAccessibleJs1.types @@ -10,9 +10,9 @@ class C { } C.blah2 = 456; >C.blah2 = 456 : 456 ->C.blah2 : any +>C.blah2 : number >C : typeof C ->blah2 : any +>blah2 : number >456 : 456 class D extends C { @@ -34,9 +34,9 @@ class D extends C { >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->super.blah2 : any +>super.blah2 : number >super : typeof C ->blah2 : any +>blah2 : number } } diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt index 2d766c4c25..3a1c1bd9a4 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt @@ -1,7 +1,5 @@ index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -namespacer.js(2,3): error TS2339: Property 'NS' does not exist on type '{}'. namespacer.js(2,8): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -namespacey.js(2,3): error TS2339: Property 'bar' does not exist on type '{}'. ==== index.js (1 errors) ==== @@ -11,17 +9,13 @@ namespacey.js(2,3): error TS2339: Property 'bar' does not exist on type '{}'. ~~~~~~ !!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== namespacey.js (1 errors) ==== +==== namespacey.js (0 errors) ==== const A = {} A.bar = class Q {} - ~~~ -!!! error TS2339: Property 'bar' does not exist on type '{}'. module.exports = A; -==== namespacer.js (2 errors) ==== +==== namespacer.js (1 errors) ==== const B = {} B.NS = require("./namespacey"); - ~~ -!!! error TS2339: Property 'NS' does not exist on type '{}'. ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(B, "NS", { value: "why though", writable: true }); diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols index fb39c7c530..20ee195557 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols @@ -22,7 +22,9 @@ const A = {} >A : Symbol(A, Decl(namespacey.js, 0, 5)) A.bar = class Q {} +>A.bar : Symbol(bar, Decl(namespacey.js, 0, 12)) >A : Symbol(A, Decl(namespacey.js, 0, 5)) +>bar : Symbol(bar, Decl(namespacey.js, 0, 12)) >Q : Symbol(Q, Decl(namespacey.js, 1, 7)) module.exports = A; @@ -36,7 +38,9 @@ const B = {} >B : Symbol(B, Decl(namespacer.js, 0, 5)) B.NS = require("./namespacey"); +>B.NS : Symbol(NS, Decl(namespacer.js, 0, 12)) >B : Symbol(B, Decl(namespacer.js, 0, 5)) +>NS : Symbol(NS, Decl(namespacer.js, 0, 12)) Object.defineProperty(B, "NS", { value: "why though", writable: true }); >Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff index d7086d697b..f7c234b782 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff @@ -29,7 +29,9 @@ ->A.bar : Symbol(A.bar, Decl(namespacey.js, 0, 12)) ->A : Symbol(A, Decl(namespacey.js, 0, 5), Decl(namespacey.js, 0, 12)) ->bar : Symbol(A.bar, Decl(namespacey.js, 0, 12)) ++>A.bar : Symbol(bar, Decl(namespacey.js, 0, 12)) +>A : Symbol(A, Decl(namespacey.js, 0, 5)) ++>bar : Symbol(bar, Decl(namespacey.js, 0, 12)) >Q : Symbol(Q, Decl(namespacey.js, 1, 7)) module.exports = A; @@ -53,7 +55,9 @@ ->NS : Symbol(B.NS, Decl(namespacer.js, 0, 12), Decl(namespacer.js, 1, 31)) ->require : Symbol(require) ->"./namespacey" : Symbol("namespacey", Decl(namespacey.js, 0, 0)) ++>B.NS : Symbol(NS, Decl(namespacer.js, 0, 12)) +>B : Symbol(B, Decl(namespacer.js, 0, 5)) ++>NS : Symbol(NS, Decl(namespacer.js, 0, 12)) Object.defineProperty(B, "NS", { value: "why though", writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types index 52cfb084c0..12e54046f8 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types @@ -2,8 +2,8 @@ === index.js === const _item = require("./namespacer"); ->_item : {} ->require("./namespacer") : {} +>_item : { NS: any; } +>require("./namespacer") : { NS: any; } >require : any >"./namespacer" : "./namespacer" @@ -27,44 +27,44 @@ Object.defineProperty(module, "exports", { value: "oh no" }); === namespacey.js === const A = {} ->A : {} ->{} : {} +>A : { bar: typeof Q; } +>{} : { bar: typeof Q; } A.bar = class Q {} >A.bar = class Q {} : typeof Q ->A.bar : any ->A : {} ->bar : any +>A.bar : typeof Q +>A : { bar: typeof Q; } +>bar : typeof Q >class Q {} : typeof Q >Q : typeof Q module.exports = A; ->module.exports = A : {} ->module.exports : {} ->module : { readonly A: {}; } ->exports : {} ->A : {} +>module.exports = A : { bar: typeof Q; } +>module.exports : { bar: typeof Q; } +>module : { readonly A: { bar: typeof Q; }; } +>exports : { bar: typeof Q; } +>A : { bar: typeof Q; } === namespacer.js === const B = {} ->B : {} ->{} : {} +>B : { NS: any; } +>{} : { NS: any; } B.NS = require("./namespacey"); >B.NS = require("./namespacey") : any >B.NS : any ->B : {} +>B : { NS: any; } >NS : any >require("./namespacey") : any >require : any >"./namespacey" : "./namespacey" Object.defineProperty(B, "NS", { value: "why though", writable: true }); ->Object.defineProperty(B, "NS", { value: "why though", writable: true }) : {} +>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : { NS: any; } >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->B : {} +>B : { NS: any; } >"NS" : "NS" >{ value: "why though", writable: true } : { value: string; writable: true; } >value : string @@ -73,9 +73,9 @@ Object.defineProperty(B, "NS", { value: "why though", writable: true }); >true : true module.exports = B; ->module.exports = B : {} ->module.exports : {} ->module : { readonly B: {}; } ->exports : {} ->B : {} +>module.exports = B : { NS: any; } +>module.exports : { NS: any; } +>module : { readonly B: { NS: any; }; } +>exports : { NS: any; } +>B : { NS: any; } diff --git a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.errors.txt b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.errors.txt index b78d9b4714..51082100d2 100644 --- a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.errors.txt @@ -1,15 +1,18 @@ -jsElementAccessNoContextualTypeCrash.js(7,8): error TS2339: Property 'localize' does not exist on type '{}'. +jsElementAccessNoContextualTypeCrash.js(2,1): error TS2322: Type '{ localize: (string: any) => any; } | {}' is not assignable to type '{ localize: (string: any) => any; }'. + Property 'localize' is missing in type '{}' but required in type '{ localize: (string: any) => any; }'. ==== jsElementAccessNoContextualTypeCrash.js (1 errors) ==== var Common = {}; self['Common'] = self['Common'] || {}; + ~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ localize: (string: any) => any; } | {}' is not assignable to type '{ localize: (string: any) => any; }'. +!!! error TS2322: Property 'localize' is missing in type '{}' but required in type '{ localize: (string: any) => any; }'. +!!! related TS2728 jsElementAccessNoContextualTypeCrash.js:7:1: 'localize' is declared here. /** * @param {string} string * @return {string} */ Common.localize = function (string) { - ~~~~~~~~ -!!! error TS2339: Property 'localize' does not exist on type '{}'. return string; }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols index afa1f0f868..b83e7550db 100644 --- a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols @@ -15,7 +15,9 @@ self['Common'] = self['Common'] || {}; * @return {string} */ Common.localize = function (string) { +>Common.localize : Symbol(localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) >Common : Symbol(Common, Decl(jsElementAccessNoContextualTypeCrash.js, 0, 3)) +>localize : Symbol(localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) >string : Symbol(string, Decl(jsElementAccessNoContextualTypeCrash.js, 6, 28)) return string; diff --git a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols.diff index 4a22ea4d85..9c740bc064 100644 --- a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.symbols.diff @@ -25,7 +25,9 @@ ->Common.localize : Symbol(Common.localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) ->Common : Symbol(Common, Decl(jsElementAccessNoContextualTypeCrash.js, 0, 3), Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) ->localize : Symbol(Common.localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) ++>Common.localize : Symbol(localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) +>Common : Symbol(Common, Decl(jsElementAccessNoContextualTypeCrash.js, 0, 3)) ++>localize : Symbol(localize, Decl(jsElementAccessNoContextualTypeCrash.js, 1, 38)) >string : Symbol(string, Decl(jsElementAccessNoContextualTypeCrash.js, 6, 28)) return string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.types b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.types index d351a5de4b..d1bc8f8328 100644 --- a/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.types +++ b/testdata/baselines/reference/submodule/compiler/jsElementAccessNoContextualTypeCrash.types @@ -2,16 +2,16 @@ === jsElementAccessNoContextualTypeCrash.js === var Common = {}; ->Common : {} ->{} : {} +>Common : { localize: (string: any) => any; } +>{} : { localize: (string: any) => any; } self['Common'] = self['Common'] || {}; ->self['Common'] = self['Common'] || {} : {} ->self['Common'] : {} +>self['Common'] = self['Common'] || {} : { localize: (string: any) => any; } | {} +>self['Common'] : { localize: (string: any) => any; } >self : Window & typeof globalThis >'Common' : "Common" ->self['Common'] || {} : {} ->self['Common'] : {} +>self['Common'] || {} : { localize: (string: any) => any; } | {} +>self['Common'] : { localize: (string: any) => any; } >self : Window & typeof globalThis >'Common' : "Common" >{} : {} @@ -22,9 +22,9 @@ self['Common'] = self['Common'] || {}; */ Common.localize = function (string) { >Common.localize = function (string) { return string;} : (string: any) => any ->Common.localize : any ->Common : {} ->localize : any +>Common.localize : (string: any) => any +>Common : { localize: (string: any) => any; } +>localize : (string: any) => any >function (string) { return string;} : (string: any) => any >string : any diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt index 313ac6eb7b..3be4b9a200 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.errors.txt @@ -1,22 +1,15 @@ -enumDef.js(2,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -enumDef.js(4,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -enumDef.js(16,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -index.js(2,7): error TS2339: Property 'Cls' does not exist on type '{}'. +enumDef.js(16,18): error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. index.js(4,17): error TS2503: Cannot find namespace 'Host'. index.js(8,21): error TS2304: Cannot find name 'Host'. index.js(13,11): error TS2503: Cannot find namespace 'Host'. index.js(18,11): error TS2503: Cannot find namespace 'Host'. -==== enumDef.js (3 errors) ==== +==== enumDef.js (1 errors) ==== var Host = {}; Host.UserMetrics = {}; - ~~~~~~~~~~~ -!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. /** @enum {number} */ Host.UserMetrics.Action = { - ~~~~~~~~~~~ -!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, @@ -29,15 +22,13 @@ index.js(18,11): error TS2503: Cannot find namespace 'Host'. * @typedef {string} */ Host.UserMetrics.Blah = { - ~~~~~~~~~~~ -!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. + ~~~~ +!!! error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. x: 12 } -==== index.js (5 errors) ==== +==== index.js (4 errors) ==== var Other = {}; Other.Cls = class { - ~~~ -!!! error TS2339: Property 'Cls' does not exist on type '{}'. /** * @param {!Host.UserMetrics.Action} p ~~~~ diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols index ac90bfca9d..28f88a4f31 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols @@ -5,11 +5,17 @@ var Host = {}; >Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) Host.UserMetrics = {}; +>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) >Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) +>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) /** @enum {number} */ Host.UserMetrics.Action = { +>Host.UserMetrics.Action : Symbol(Action, Decl(enumDef.js, 1, 22)) +>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) >Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) +>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) +>Action : Symbol(Action, Decl(enumDef.js, 1, 22)) WindowDocked: 1, >WindowDocked : Symbol(WindowDocked, Decl(enumDef.js, 3, 27)) @@ -31,7 +37,9 @@ Host.UserMetrics.Action = { * @typedef {string} */ Host.UserMetrics.Blah = { +>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) >Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) +>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) x: 12 >x : Symbol(x, Decl(enumDef.js, 15, 25)) @@ -41,7 +49,9 @@ var Other = {}; >Other : Symbol(Other, Decl(index.js, 0, 3)) Other.Cls = class { +>Other.Cls : Symbol(Cls, Decl(index.js, 0, 15)) >Other : Symbol(Other, Decl(index.js, 0, 3)) +>Cls : Symbol(Cls, Decl(index.js, 0, 15)) /** * @param {!Host.UserMetrics.Action} p diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols.diff index 289b1f2f04..80901e91ae 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.symbols.diff @@ -11,7 +11,9 @@ ->Host.UserMetrics : Symbol(Host.UserMetrics, Decl(enumDef.js, 0, 14), Decl(enumDef.js, 3, 5), Decl(enumDef.js, 15, 5), Decl(enumDef.js, 10, 26)) ->Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 0, 14), Decl(enumDef.js, 1, 22), Decl(enumDef.js, 8, 2), Decl(enumDef.js, 10, 21)) ->UserMetrics : Symbol(Host.UserMetrics, Decl(enumDef.js, 0, 14), Decl(enumDef.js, 3, 5), Decl(enumDef.js, 15, 5), Decl(enumDef.js, 10, 26)) ++>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) +>Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) ++>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) /** @enum {number} */ Host.UserMetrics.Action = { @@ -20,11 +22,15 @@ ->Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 0, 14), Decl(enumDef.js, 1, 22), Decl(enumDef.js, 8, 2), Decl(enumDef.js, 10, 21)) ->UserMetrics : Symbol(Host.UserMetrics, Decl(enumDef.js, 0, 14), Decl(enumDef.js, 3, 5), Decl(enumDef.js, 15, 5), Decl(enumDef.js, 10, 26)) ->Action : Symbol(Host.UserMetrics.Action, Decl(enumDef.js, 1, 22), Decl(enumDef.js, 3, 17), Decl(enumDef.js, 2, 4)) ++>Host.UserMetrics.Action : Symbol(Action, Decl(enumDef.js, 1, 22)) ++>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) +>Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) ++>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) ++>Action : Symbol(Action, Decl(enumDef.js, 1, 22)) WindowDocked: 1, >WindowDocked : Symbol(WindowDocked, Decl(enumDef.js, 3, 27)) -@@= skipped -35, +29 lines =@@ +@@= skipped -35, +35 lines =@@ * @typedef {string} */ Host.UserMetrics.Blah = { @@ -33,7 +39,9 @@ ->Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 0, 14), Decl(enumDef.js, 1, 22), Decl(enumDef.js, 8, 2), Decl(enumDef.js, 10, 21)) ->UserMetrics : Symbol(Host.UserMetrics, Decl(enumDef.js, 0, 14), Decl(enumDef.js, 3, 5), Decl(enumDef.js, 15, 5), Decl(enumDef.js, 10, 26)) ->Blah : Symbol(Host.UserMetrics.Blah, Decl(enumDef.js, 8, 2), Decl(enumDef.js, 15, 17), Decl(enumDef.js, 13, 3)) ++>Host.UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) +>Host : Symbol(Host, Decl(enumDef.js, 0, 3), Decl(enumDef.js, 10, 3)) ++>UserMetrics : Symbol(UserMetrics, Decl(enumDef.js, 0, 14)) x: 12 >x : Symbol(x, Decl(enumDef.js, 15, 25)) @@ -47,7 +55,9 @@ ->Other.Cls : Symbol(Other.Cls, Decl(index.js, 0, 15)) ->Other : Symbol(Other, Decl(index.js, 0, 3), Decl(index.js, 0, 15)) ->Cls : Symbol(Other.Cls, Decl(index.js, 0, 15)) ++>Other.Cls : Symbol(Cls, Decl(index.js, 0, 15)) +>Other : Symbol(Other, Decl(index.js, 0, 3)) ++>Cls : Symbol(Cls, Decl(index.js, 0, 15)) /** * @param {!Host.UserMetrics.Action} p diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.types b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.types index 69cfce63ee..31d40349d8 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.types +++ b/testdata/baselines/reference/submodule/compiler/jsEnumCrossFileExport.types @@ -2,24 +2,24 @@ === enumDef.js === var Host = {}; ->Host : {} ->{} : {} +>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } +>{} : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } Host.UserMetrics = {}; ->Host.UserMetrics = {} : {} ->Host.UserMetrics : any ->Host : {} ->UserMetrics : any ->{} : {} +>Host.UserMetrics = {} : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } +>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>{} : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } /** @enum {number} */ Host.UserMetrics.Action = { >Host.UserMetrics.Action = { WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, TimelineStarted: 4,} : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } ->Host.UserMetrics.Action : any ->Host.UserMetrics : any ->Host : {} ->UserMetrics : any ->Action : any +>Host.UserMetrics.Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } +>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } +>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } >{ WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, TimelineStarted: 4,} : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } WindowDocked: 1, @@ -48,9 +48,9 @@ Host.UserMetrics.Action = { Host.UserMetrics.Blah = { >Host.UserMetrics.Blah = { x: 12} : { x: number; } >Host.UserMetrics.Blah : any ->Host.UserMetrics : any ->Host : {} ->UserMetrics : any +>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } +>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } >Blah : any >{ x: 12} : { x: number; } @@ -60,14 +60,14 @@ Host.UserMetrics.Blah = { } === index.js === var Other = {}; ->Other : {} ->{} : {} +>Other : { Cls: typeof Cls; } +>{} : { Cls: typeof Cls; } Other.Cls = class { >Other.Cls = class { /** * @param {!Host.UserMetrics.Action} p */ method(p) {} usage() { this.method(Host.UserMetrics.Action.WindowDocked); }} : typeof Cls ->Other.Cls : any ->Other : {} ->Cls : any +>Other.Cls : typeof Cls +>Other : { Cls: typeof Cls; } +>Cls : typeof Cls >class { /** * @param {!Host.UserMetrics.Action} p */ method(p) {} usage() { this.method(Host.UserMetrics.Action.WindowDocked); }} : typeof Cls /** diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt index 63593f717d..6731112bb6 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt @@ -1,26 +1,14 @@ -assignmentToVoidZero2.js(4,3): error TS2339: Property 'x' does not exist on type '{}'. -assignmentToVoidZero2.js(5,3): error TS2339: Property 'y' does not exist on type '{}'. -assignmentToVoidZero2.js(6,3): error TS2339: Property 'x' does not exist on type '{}'. -assignmentToVoidZero2.js(6,9): error TS2339: Property 'y' does not exist on type '{}'. assignmentToVoidZero2.js(12,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. importer.js(2,1): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. -==== assignmentToVoidZero2.js (5 errors) ==== +==== assignmentToVoidZero2.js (1 errors) ==== exports.j = 1; exports.k = void 0; var o = {} o.x = 1 - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. o.y = void 0 - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. o.x + o.y - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. - ~ -!!! error TS2339: Property 'y' does not exist on type '{}'. function C() { this.p = 1 diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols index e71bf2034d..6af568668a 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols @@ -15,14 +15,22 @@ var o = {} >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) o.x = 1 +>o.x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) +>x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) o.y = void 0 +>o.y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) +>y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) o.x + o.y +>o.x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) +>x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) +>o.y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) +>y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) function C() { >C : Symbol(C, Decl(assignmentToVoidZero2.js, 5, 9)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff index cf3e31a404..501a090bde 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff @@ -21,19 +21,27 @@ ->o.x : Symbol(o.x, Decl(assignmentToVoidZero2.js, 2, 10)) ->o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10)) ->x : Symbol(o.x, Decl(assignmentToVoidZero2.js, 2, 10)) ++>o.x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) +>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) ++>x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) o.y = void 0 ->o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10)) ++>o.y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) +>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) ++>y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) o.x + o.y ->o.x : Symbol(o.x, Decl(assignmentToVoidZero2.js, 2, 10)) ->o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10)) ->x : Symbol(o.x, Decl(assignmentToVoidZero2.js, 2, 10)) ->o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10)) ++>o.x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) +>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) ++>x : Symbol(x, Decl(assignmentToVoidZero2.js, 2, 10)) ++>o.y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) +>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) ++>y : Symbol(y, Decl(assignmentToVoidZero2.js, 3, 7)) function C() { >C : Symbol(C, Decl(assignmentToVoidZero2.js, 5, 9)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types index b45e033e87..a45837679f 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types @@ -17,31 +17,31 @@ exports.k = void 0; >0 : 0 var o = {} ->o : {} ->{} : {} +>o : { x: number; y: any; } +>{} : { x: number; y: any; } o.x = 1 >o.x = 1 : 1 ->o.x : any ->o : {} ->x : any +>o.x : number +>o : { x: number; y: any; } +>x : number >1 : 1 o.y = void 0 >o.y = void 0 : undefined >o.y : any ->o : {} +>o : { x: number; y: any; } >y : any >void 0 : undefined >0 : 0 o.x + o.y >o.x + o.y : any ->o.x : any ->o : {} ->x : any +>o.x : number +>o : { x: number; y: any; } +>x : number >o.y : any ->o : {} +>o : { x: number; y: any; } >y : any function C() { diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols index ba8fe2ff41..7d83e2d1a6 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols @@ -60,12 +60,12 @@ exports.B = B >B : Symbol(B, Decl(mod.js, 4, 3)) A.prototype = B.prototype = { ->A.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>A.prototype : Symbol(prototype, Decl(mod.js, 8, 13)) >A : Symbol(A, Decl(mod.js, 1, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ->B.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(mod.js, 8, 13)) +>B.prototype : Symbol(prototype, Decl(mod.js, 9, 13)) >B : Symbol(B, Decl(mod.js, 4, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(mod.js, 9, 13)) /** @param {number} n */ m(n) { diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff index 93039e25b5..678af985d9 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff @@ -81,12 +81,12 @@ ->B.prototype : Symbol(B.prototype, Decl(mod.js, 9, 13)) ->B : Symbol(B, Decl(mod.js, 4, 3), Decl(mod.js, 9, 13)) ->prototype : Symbol(B.prototype, Decl(mod.js, 9, 13)) -+>A.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>A.prototype : Symbol(prototype, Decl(mod.js, 8, 13)) +>A : Symbol(A, Decl(mod.js, 1, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) -+>B.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(mod.js, 8, 13)) ++>B.prototype : Symbol(prototype, Decl(mod.js, 9, 13)) +>B : Symbol(B, Decl(mod.js, 4, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(mod.js, 9, 13)) /** @param {number} n */ m(n) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types index d4f8f672f2..4dbebc0c05 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types @@ -11,16 +11,16 @@ var mod = require('./mod'); var a = new mod.A() >a : any >new mod.A() : any ->mod.A : () => void +>mod.A : { (): void; prototype: { m(n: number): number; }; } >mod : typeof mod ->A : () => void +>A : { (): void; prototype: { m(n: number): number; }; } var b = new mod.B() >b : any >new mod.B() : any ->mod.B : () => void +>mod.B : { (): void; prototype: { m(n: number): number; }; } >mod : typeof mod ->B : () => void +>B : { (): void; prototype: { m(n: number): number; }; } a.m('nope') >a.m('nope') : any @@ -47,9 +47,9 @@ declare var exports: any; === mod.js === /// var A = function A() { ->A : () => void ->function A() { this.a = 1} : () => void ->A : () => void +>A : { (): void; prototype: { m(n: number): number; }; } +>function A() { this.a = 1} : { (): void; prototype: { m(n: number): number; }; } +>A : { (): void; prototype: { m(n: number): number; }; } this.a = 1 >this.a = 1 : 1 @@ -59,9 +59,9 @@ var A = function A() { >1 : 1 } var B = function B() { ->B : () => void ->function B() { this.b = 2} : () => void ->B : () => void +>B : { (): void; prototype: { m(n: number): number; }; } +>function B() { this.b = 2} : { (): void; prototype: { m(n: number): number; }; } +>B : { (): void; prototype: { m(n: number): number; }; } this.b = 2 >this.b = 2 : 2 @@ -71,28 +71,28 @@ var B = function B() { >2 : 2 } exports.A = A ->exports.A = A : () => void ->exports.A : () => void +>exports.A = A : { (): void; prototype: { m(n: number): number; }; } +>exports.A : { (): void; prototype: { m(n: number): number; }; } >exports : typeof import("./mod") ->A : () => void ->A : () => void +>A : { (): void; prototype: { m(n: number): number; }; } +>A : { (): void; prototype: { m(n: number): number; }; } exports.B = B ->exports.B = B : () => void ->exports.B : () => void +>exports.B = B : { (): void; prototype: { m(n: number): number; }; } +>exports.B : { (): void; prototype: { m(n: number): number; }; } >exports : typeof import("./mod") ->B : () => void ->B : () => void +>B : { (): void; prototype: { m(n: number): number; }; } +>B : { (): void; prototype: { m(n: number): number; }; } A.prototype = B.prototype = { >A.prototype = B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } ->A.prototype : any ->A : () => void ->prototype : any +>A.prototype : { m(n: number): number; } +>A : { (): void; prototype: { m(n: number): number; }; } +>prototype : { m(n: number): number; } >B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } ->B.prototype : any ->B : () => void ->prototype : any +>B.prototype : { m(n: number): number; } +>B : { (): void; prototype: { m(n: number): number; }; } +>prototype : { m(n: number): number; } >{ /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } /** @param {number} n */ diff --git a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.errors.txt b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.errors.txt index f2698865d7..b5466ed2eb 100644 --- a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.errors.txt @@ -1,13 +1,10 @@ -bug24252.js(2,3): error TS2339: Property 'B' does not exist on type '{}'. bug24252.js(8,9): error TS2322: Type 'string[]' is not assignable to type 'number[]'. Type 'string' is not assignable to type 'number'. -==== bug24252.js (2 errors) ==== +==== bug24252.js (1 errors) ==== var A = {}; A.B = class { - ~ -!!! error TS2339: Property 'B' does not exist on type '{}'. m() { /** @type {string[]} */ var x = []; diff --git a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols index 9309daac24..104ee0551f 100644 --- a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols +++ b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols @@ -5,7 +5,9 @@ var A = {}; >A : Symbol(A, Decl(bug24252.js, 0, 3)) A.B = class { +>A.B : Symbol(B, Decl(bug24252.js, 0, 11)) >A : Symbol(A, Decl(bug24252.js, 0, 3)) +>B : Symbol(B, Decl(bug24252.js, 0, 11)) m() { >m : Symbol(m, Decl(bug24252.js, 1, 13)) diff --git a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols.diff b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols.diff index 94ad4dc491..c70f8c8502 100644 --- a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.symbols.diff @@ -11,7 +11,9 @@ ->A.B : Symbol(A.B, Decl(bug24252.js, 0, 11)) ->A : Symbol(A, Decl(bug24252.js, 0, 3), Decl(bug24252.js, 0, 11)) ->B : Symbol(A.B, Decl(bug24252.js, 0, 11)) ++>A.B : Symbol(B, Decl(bug24252.js, 0, 11)) +>A : Symbol(A, Decl(bug24252.js, 0, 3)) ++>B : Symbol(B, Decl(bug24252.js, 0, 11)) m() { ->m : Symbol(B.m, Decl(bug24252.js, 1, 13)) diff --git a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.types b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.types index fdb014f9a0..3f93e65480 100644 --- a/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.types +++ b/testdata/baselines/reference/submodule/conformance/checkSpecialPropertyAssignments.types @@ -2,14 +2,14 @@ === bug24252.js === var A = {}; ->A : {} ->{} : {} +>A : { B: typeof B; } +>{} : { B: typeof B; } A.B = class { >A.B = class { m() { /** @type {string[]} */ var x = []; /** @type {number[]} */ var y; y = x; }} : typeof B ->A.B : any ->A : {} ->B : any +>A.B : typeof B +>A : { B: typeof B; } +>B : typeof B >class { m() { /** @type {string[]} */ var x = []; /** @type {number[]} */ var y; y = x; }} : typeof B m() { diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt index 1e22d63b93..109a57b0b7 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt @@ -1,7 +1,4 @@ main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -mod1.js(2,4): error TS2339: Property 'K' does not exist on type '{}'. -mod1.js(4,23): error TS2339: Property 'K' does not exist on type '{}'. -mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. ==== main.js (1 errors) ==== @@ -13,18 +10,12 @@ mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. k.values() } -==== mod1.js (3 errors) ==== +==== mod1.js (0 errors) ==== var NS = {} NS.K =class { - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. values() { return new NS.K() - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. } } exports.K = NS.K; - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols index db7c82a286..04cb23fe7c 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols @@ -20,18 +20,24 @@ var NS = {} >NS : Symbol(NS, Decl(mod1.js, 0, 3)) NS.K =class { +>NS.K : Symbol(K, Decl(mod1.js, 0, 11)) >NS : Symbol(NS, Decl(mod1.js, 0, 3)) +>K : Symbol(K, Decl(mod1.js, 0, 11)) values() { >values : Symbol(values, Decl(mod1.js, 1, 13)) return new NS.K() +>NS.K : Symbol(K, Decl(mod1.js, 0, 11)) >NS : Symbol(NS, Decl(mod1.js, 0, 3)) +>K : Symbol(K, Decl(mod1.js, 0, 11)) } } exports.K = NS.K; >exports.K : Symbol(K, Decl(mod1.js, 5, 1)) >exports : Symbol("mod1", Decl(mod1.js, 0, 0)) >K : Symbol(K, Decl(mod1.js, 5, 1)) +>NS.K : Symbol(K, Decl(mod1.js, 0, 11)) >NS : Symbol(NS, Decl(mod1.js, 0, 3)) +>K : Symbol(K, Decl(mod1.js, 0, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff index c104e667d7..109b046dc5 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff @@ -15,20 +15,20 @@ +>NS : Symbol(NS, Decl(mod1.js, 0, 3)) NS.K =class { -->NS.K : Symbol(K, Decl(mod1.js, 0, 11)) + >NS.K : Symbol(K, Decl(mod1.js, 0, 11)) ->NS : Symbol(NS, Decl(mod1.js, 0, 3), Decl(mod1.js, 0, 11)) -->K : Symbol(K, Decl(mod1.js, 0, 11)) +>NS : Symbol(NS, Decl(mod1.js, 0, 3)) + >K : Symbol(K, Decl(mod1.js, 0, 11)) values() { ->values : Symbol(K.values, Decl(mod1.js, 1, 13)) +>values : Symbol(values, Decl(mod1.js, 1, 13)) return new NS.K() -->NS.K : Symbol(K, Decl(mod1.js, 0, 11)) + >NS.K : Symbol(K, Decl(mod1.js, 0, 11)) ->NS : Symbol(NS, Decl(mod1.js, 0, 3), Decl(mod1.js, 0, 11)) -->K : Symbol(K, Decl(mod1.js, 0, 11)) +>NS : Symbol(NS, Decl(mod1.js, 0, 3)) + >K : Symbol(K, Decl(mod1.js, 0, 11)) } } exports.K = NS.K; @@ -36,7 +36,7 @@ ->exports : Symbol(K, Decl(mod1.js, 5, 1)) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) >K : Symbol(K, Decl(mod1.js, 5, 1)) -->NS.K : Symbol(K, Decl(mod1.js, 0, 11)) + >NS.K : Symbol(K, Decl(mod1.js, 0, 11)) ->NS : Symbol(NS, Decl(mod1.js, 0, 3), Decl(mod1.js, 0, 11)) -->K : Symbol(K, Decl(mod1.js, 0, 11)) +>NS : Symbol(NS, Decl(mod1.js, 0, 3)) + >K : Symbol(K, Decl(mod1.js, 0, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types index 9cd434867e..37695a5a8d 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types @@ -2,7 +2,7 @@ === main.js === const { K } = require("./mod1"); ->K : any +>K : typeof K >require("./mod1") : typeof import("./mod1") >require : any >"./mod1" : "./mod1" @@ -21,32 +21,32 @@ function f(k) { === mod1.js === var NS = {} ->NS : {} ->{} : {} +>NS : { K: typeof K; } +>{} : { K: typeof K; } NS.K =class { >NS.K =class { values() { return new NS.K() }} : typeof K ->NS.K : any ->NS : {} ->K : any +>NS.K : typeof K +>NS : { K: typeof K; } +>K : typeof K >class { values() { return new NS.K() }} : typeof K values() { ->values : () => any +>values : () => K return new NS.K() ->new NS.K() : any ->NS.K : any ->NS : {} ->K : any +>new NS.K() : K +>NS.K : typeof K +>NS : { K: typeof K; } +>K : typeof K } } exports.K = NS.K; ->exports.K = NS.K : any ->exports.K : any +>exports.K = NS.K : typeof K +>exports.K : typeof K >exports : typeof import("./mod1") ->K : any ->NS.K : any ->NS : {} ->K : any +>K : typeof K +>NS.K : typeof K +>NS : { K: typeof K; } +>K : typeof K diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt index 34df0c9b04..8d6f95d2da 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt @@ -1,15 +1,11 @@ -test.js(9,4): error TS2339: Property 'x' does not exist on type '{}'. -test.js(14,4): error TS2339: Property 'x' does not exist on type '{}'. test.js(16,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -test.js(18,4): error TS2339: Property 'x' does not exist on type '{}'. test.js(33,13): error TS2322: Type 'string' is not assignable to type '"done"'. test.js(34,15): error TS7006: Parameter 'n' implicitly has an 'any' type. test.js(57,17): error TS2339: Property 'x' does not exist on type 'Thing'. -test.js(59,7): error TS7006: Parameter 'n' implicitly has an 'any' type. test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. -==== test.js (9 errors) ==== +==== test.js (5 errors) ==== /** @typedef {{ status: 'done' m(n: number): void @@ -19,23 +15,17 @@ test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. var ns = {} /** @type {DoneStatus} */ ns.x = { - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. status: 'done', m(n) { } } ns.x = { - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. status: 'done', m(n) { } ~ !!! error TS7006: Parameter 'n' implicitly has an 'any' type. } ns.x - ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. // this-property assignment @@ -84,8 +74,6 @@ test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. !!! error TS2339: Property 'x' does not exist on type 'Thing'. status: 'done', m(n) { } - ~ -!!! error TS7006: Parameter 'n' implicitly has an 'any' type. } Thing.prototype.x ~ diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols index f8ecaed1ce..48cddc5555 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols @@ -12,7 +12,9 @@ var ns = {} /** @type {DoneStatus} */ ns.x = { +>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) >ns : Symbol(ns, Decl(test.js, 6, 3)) +>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) status: 'done', >status : Symbol(status, Decl(test.js, 8, 8)) @@ -23,7 +25,9 @@ ns.x = { } ns.x = { +>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) >ns : Symbol(ns, Decl(test.js, 6, 3)) +>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) status: 'done', >status : Symbol(status, Decl(test.js, 13, 8)) @@ -33,7 +37,9 @@ ns.x = { >n : Symbol(n, Decl(test.js, 15, 6)) } ns.x +>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) >ns : Symbol(ns, Decl(test.js, 6, 3)) +>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) // this-property assignment diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff index 127a31c822..7e0df2fa1c 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff @@ -12,33 +12,39 @@ ->ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ++>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) +>ns : Symbol(ns, Decl(test.js, 6, 3)) ++>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) status: 'done', >status : Symbol(status, Decl(test.js, 8, 8)) -@@= skipped -17, +15 lines =@@ +@@= skipped -17, +17 lines =@@ } ns.x = { ->ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ++>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) +>ns : Symbol(ns, Decl(test.js, 6, 3)) ++>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) status: 'done', >status : Symbol(status, Decl(test.js, 13, 8)) -@@= skipped -12, +10 lines =@@ +@@= skipped -12, +12 lines =@@ >n : Symbol(n, Decl(test.js, 15, 6)) } ns.x ->ns.x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->ns : Symbol(ns, Decl(test.js, 6, 3), Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ->x : Symbol(ns.x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) ++>ns.x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) +>ns : Symbol(ns, Decl(test.js, 6, 3)) ++>x : Symbol(x, Decl(test.js, 6, 11), Decl(test.js, 11, 1)) // this-property assignment -@@= skipped -12, +10 lines =@@ +@@= skipped -12, +12 lines =@@ constructor() { /** @type {DoneStatus} */ this.s = { diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types index f04c928353..197df45d9e 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types @@ -8,15 +8,15 @@ // property assignment var ns = {} ->ns : {} ->{} : {} +>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } +>{} : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } /** @type {DoneStatus} */ ns.x = { >ns.x = { status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } ->ns.x : any ->ns : {} ->x : any +>ns.x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } +>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } +>x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } >{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } >{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } @@ -31,9 +31,9 @@ ns.x = { ns.x = { >ns.x = { status: 'done', m(n) { }} : { status: string; m(n: any): void; } ->ns.x : any ->ns : {} ->x : any +>ns.x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } +>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } +>x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } >{ status: 'done', m(n) { }} : { status: string; m(n: any): void; } status: 'done', @@ -45,9 +45,9 @@ ns.x = { >n : any } ns.x ->ns.x : any ->ns : {} ->x : any +>ns.x : { status: string; m(n: any): void; } +>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } +>x : { status: string; m(n: any): void; } // this-property assignment @@ -148,21 +148,22 @@ module.exports.y // prototype-property assignment /** @type {DoneStatus} */ Thing.prototype.x = { ->Thing.prototype.x = { status: 'done', m(n) { }} : { status: string; m(n: any): void; } +>Thing.prototype.x = { status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } >Thing.prototype.x : any >Thing.prototype : Thing >Thing : typeof Thing >prototype : Thing >x : any ->{ status: 'done', m(n) { }} : { status: string; m(n: any): void; } +>{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } +>{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } status: 'done', ->status : string +>status : "done" >'done' : "done" m(n) { } ->m : (n: any) => void ->n : any +>m : (n: number) => void +>n : number } Thing.prototype.x >Thing.prototype.x : any diff --git a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt deleted file mode 100644 index df70b767e5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -bug39167.js(2,6): error TS2339: Property 'K' does not exist on type '{}'. -bug39167.js(2,15): error TS2339: Property 'K' does not exist on type '{}'. -bug39167.js(5,6): error TS2339: Property 'K' does not exist on type '{}'. -bug39167.js(9,10): error TS2339: Property 'K' does not exist on type '{}'. - - -==== bug39167.js (4 errors) ==== - var test = {}; - test.K = test.K || - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. - function () {} - - test.K.prototype = { - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. - add() {} - }; - - new test.K().add; - ~ -!!! error TS2339: Property 'K' does not exist on type '{}'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols index 0fd0120136..2b94d7f4ad 100644 --- a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols +++ b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols @@ -5,13 +5,19 @@ var test = {}; >test : Symbol(test, Decl(bug39167.js, 0, 3)) test.K = test.K || +>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) >test : Symbol(test, Decl(bug39167.js, 0, 3)) +>K : Symbol(K, Decl(bug39167.js, 0, 14)) +>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) >test : Symbol(test, Decl(bug39167.js, 0, 3)) +>K : Symbol(K, Decl(bug39167.js, 0, 14)) function () {} test.K.prototype = { +>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) >test : Symbol(test, Decl(bug39167.js, 0, 3)) +>K : Symbol(K, Decl(bug39167.js, 0, 14)) add() {} >add : Symbol(add, Decl(bug39167.js, 4, 20)) @@ -19,5 +25,7 @@ test.K.prototype = { }; new test.K().add; +>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) >test : Symbol(test, Decl(bug39167.js, 0, 3)) +>K : Symbol(K, Decl(bug39167.js, 0, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols.diff b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols.diff index c9144f7cf2..04f4320e72 100644 --- a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.symbols.diff @@ -14,8 +14,12 @@ ->test.K : Symbol(test.K, Decl(bug39167.js, 0, 14), Decl(bug39167.js, 4, 5)) ->test : Symbol(test, Decl(bug39167.js, 0, 3), Decl(bug39167.js, 0, 14), Decl(bug39167.js, 2, 18)) ->K : Symbol(test.K, Decl(bug39167.js, 0, 14), Decl(bug39167.js, 4, 5)) ++>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) +>test : Symbol(test, Decl(bug39167.js, 0, 3)) ++>K : Symbol(K, Decl(bug39167.js, 0, 14)) ++>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) +>test : Symbol(test, Decl(bug39167.js, 0, 3)) ++>K : Symbol(K, Decl(bug39167.js, 0, 14)) function () {} @@ -25,11 +29,13 @@ ->test : Symbol(test, Decl(bug39167.js, 0, 3), Decl(bug39167.js, 0, 14), Decl(bug39167.js, 2, 18)) ->K : Symbol(test.K, Decl(bug39167.js, 0, 14), Decl(bug39167.js, 4, 5)) ->prototype : Symbol(test.K.prototype, Decl(bug39167.js, 2, 18)) ++>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) +>test : Symbol(test, Decl(bug39167.js, 0, 3)) ++>K : Symbol(K, Decl(bug39167.js, 0, 14)) add() {} >add : Symbol(add, Decl(bug39167.js, 4, 20)) -@@= skipped -25, +17 lines =@@ +@@= skipped -25, +23 lines =@@ }; new test.K().add; @@ -38,4 +44,6 @@ ->test : Symbol(test, Decl(bug39167.js, 0, 3), Decl(bug39167.js, 0, 14), Decl(bug39167.js, 2, 18)) ->K : Symbol(test.K, Decl(bug39167.js, 0, 14), Decl(bug39167.js, 4, 5)) ->add : Symbol(add, Decl(bug39167.js, 4, 20)) ++>test.K : Symbol(K, Decl(bug39167.js, 0, 14)) +>test : Symbol(test, Decl(bug39167.js, 0, 3)) ++>K : Symbol(K, Decl(bug39167.js, 0, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.types b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.types index 2808879388..1443bbe4cd 100644 --- a/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.types +++ b/testdata/baselines/reference/submodule/conformance/defaultPropertyAssignedClassWithPrototype.types @@ -2,17 +2,17 @@ === bug39167.js === var test = {}; ->test : {} ->{} : {} +>test : { K: any; } +>{} : { K: any; } test.K = test.K || >test.K = test.K || function () {} : any >test.K : any ->test : {} +>test : { K: any; } >K : any >test.K || function () {} : any >test.K : any ->test : {} +>test : { K: any; } >K : any function () {} @@ -22,7 +22,7 @@ test.K.prototype = { >test.K.prototype = { add() {}} : { add(): void; } >test.K.prototype : any >test.K : any ->test : {} +>test : { K: any; } >K : any >prototype : any >{ add() {}} : { add(): void; } @@ -36,7 +36,7 @@ new test.K().add; >new test.K().add : any >new test.K() : any >test.K : any ->test : {} +>test : { K: any; } >K : any >add : any diff --git a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.errors.txt b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.errors.txt deleted file mode 100644 index 5cd1f0d60f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.errors.txt +++ /dev/null @@ -1,61 +0,0 @@ -b.ts(4,14): error TS2339: Property 'staticProp' does not exist on type 'typeof C1'. -b.ts(5,14): error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. -b.ts(7,14): error TS2339: Property 'staticProp' does not exist on type '() => void'. -b.ts(10,12): error TS2339: Property 'staticProp' does not exist on type 'typeof C3'. -b.ts(11,12): error TS2339: Property 'staticProp' does not exist on type 'typeof C4'. -b.ts(13,12): error TS2339: Property 'staticProp' does not exist on type '() => void'. - - -==== a.js (0 errors) ==== - export class C1 { } - C1.staticProp = 0; - - export function F1() { } - F1.staticProp = 0; - - export var C2 = class { }; - C2.staticProp = 0; - - export let F2 = function () { }; - F2.staticProp = 0; - -==== global.js (0 errors) ==== - class C3 { } - C3.staticProp = 0; - - function F3() { } - F3.staticProp = 0; - - var C4 = class { }; - C4.staticProp = 0; - - let F4 = function () { }; - F4.staticProp = 0; - -==== b.ts (6 errors) ==== - import * as a from "./a"; - var n: number; - - var n = a.C1.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C1'. - var n = a.C2.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. - var n = a.F1.staticProp; - var n = a.F2.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type '() => void'. - - - var n = C3.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C3'. - var n = C4.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C4'. - var n = F3.staticProp; - var n = F4.staticProp; - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type '() => void'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols index e4395e0828..2dac818325 100644 --- a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols +++ b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols @@ -5,7 +5,9 @@ export class C1 { } >C1 : Symbol(C1, Decl(a.js, 0, 0)) C1.staticProp = 0; +>C1.staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) >C1 : Symbol(C1, Decl(a.js, 0, 0)) +>staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) export function F1() { } >F1 : Symbol(F1, Decl(a.js, 1, 18)) @@ -19,20 +21,26 @@ export var C2 = class { }; >C2 : Symbol(C2, Decl(a.js, 6, 10)) C2.staticProp = 0; +>C2.staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) >C2 : Symbol(C2, Decl(a.js, 6, 10)) +>staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) export let F2 = function () { }; >F2 : Symbol(F2, Decl(a.js, 9, 10)) F2.staticProp = 0; +>F2.staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) >F2 : Symbol(F2, Decl(a.js, 9, 10)) +>staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) === global.js === class C3 { } >C3 : Symbol(C3, Decl(global.js, 0, 0)) C3.staticProp = 0; +>C3.staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) >C3 : Symbol(C3, Decl(global.js, 0, 0)) +>staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) function F3() { } >F3 : Symbol(F3, Decl(global.js, 1, 18)) @@ -46,13 +54,17 @@ var C4 = class { }; >C4 : Symbol(C4, Decl(global.js, 6, 3)) C4.staticProp = 0; +>C4.staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) >C4 : Symbol(C4, Decl(global.js, 6, 3)) +>staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) let F4 = function () { }; >F4 : Symbol(F4, Decl(global.js, 9, 3)) F4.staticProp = 0; +>F4.staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) >F4 : Symbol(F4, Decl(global.js, 9, 3)) +>staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) === b.ts === import * as a from "./a"; @@ -63,15 +75,19 @@ var n: number; var n = a.C1.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>a.C1.staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) >a.C1 : Symbol(C1, Decl(a.js, 0, 0)) >a : Symbol(a, Decl(b.ts, 0, 6)) >C1 : Symbol(C1, Decl(a.js, 0, 0)) +>staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) var n = a.C2.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>a.C2.staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) >a.C2 : Symbol(C2, Decl(a.js, 6, 10)) >a : Symbol(a, Decl(b.ts, 0, 6)) >C2 : Symbol(C2, Decl(a.js, 6, 10)) +>staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) var n = a.F1.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) @@ -83,18 +99,24 @@ var n = a.F1.staticProp; var n = a.F2.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>a.F2.staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) >a.F2 : Symbol(F2, Decl(a.js, 9, 10)) >a : Symbol(a, Decl(b.ts, 0, 6)) >F2 : Symbol(F2, Decl(a.js, 9, 10)) +>staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) var n = C3.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>C3.staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) >C3 : Symbol(C3, Decl(global.js, 0, 0)) +>staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) var n = C4.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>C4.staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) >C4 : Symbol(C4, Decl(global.js, 6, 3)) +>staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) var n = F3.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) @@ -104,5 +126,7 @@ var n = F3.staticProp; var n = F4.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) +>F4.staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) >F4 : Symbol(F4, Decl(global.js, 9, 3)) +>staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) diff --git a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols.diff b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols.diff index e5beb801f8..dfb94e67a3 100644 --- a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.symbols.diff @@ -11,7 +11,9 @@ ->C1.staticProp : Symbol(C1.staticProp, Decl(a.js, 0, 19)) ->C1 : Symbol(C1, Decl(a.js, 0, 0), Decl(a.js, 0, 19)) ->staticProp : Symbol(C1.staticProp, Decl(a.js, 0, 19)) ++>C1.staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) +>C1 : Symbol(C1, Decl(a.js, 0, 0)) ++>staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) export function F1() { } ->F1 : Symbol(F1, Decl(a.js, 1, 18), Decl(a.js, 3, 24)) @@ -33,7 +35,9 @@ ->C2.staticProp : Symbol(C2.staticProp, Decl(a.js, 6, 26)) ->C2 : Symbol(C2, Decl(a.js, 6, 10), Decl(a.js, 6, 26)) ->staticProp : Symbol(C2.staticProp, Decl(a.js, 6, 26)) ++>C2.staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) +>C2 : Symbol(C2, Decl(a.js, 6, 10)) ++>staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) export let F2 = function () { }; ->F2 : Symbol(F2, Decl(a.js, 9, 10), Decl(a.js, 9, 32)) @@ -43,7 +47,9 @@ ->F2.staticProp : Symbol(F2.staticProp, Decl(a.js, 9, 32)) ->F2 : Symbol(F2, Decl(a.js, 9, 10), Decl(a.js, 9, 32)) ->staticProp : Symbol(F2.staticProp, Decl(a.js, 9, 32)) ++>F2.staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) +>F2 : Symbol(F2, Decl(a.js, 9, 10)) ++>staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) === global.js === class C3 { } @@ -54,7 +60,9 @@ ->C3.staticProp : Symbol(C3.staticProp, Decl(global.js, 0, 12)) ->C3 : Symbol(C3, Decl(global.js, 0, 0), Decl(global.js, 0, 12)) ->staticProp : Symbol(C3.staticProp, Decl(global.js, 0, 12)) ++>C3.staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) +>C3 : Symbol(C3, Decl(global.js, 0, 0)) ++>staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) function F3() { } ->F3 : Symbol(F3, Decl(global.js, 1, 18), Decl(global.js, 3, 17)) @@ -76,7 +84,9 @@ ->C4.staticProp : Symbol(C4.staticProp, Decl(global.js, 6, 19)) ->C4 : Symbol(C4, Decl(global.js, 6, 3), Decl(global.js, 6, 19)) ->staticProp : Symbol(C4.staticProp, Decl(global.js, 6, 19)) ++>C4.staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) +>C4 : Symbol(C4, Decl(global.js, 6, 3)) ++>staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) let F4 = function () { }; ->F4 : Symbol(F4, Decl(global.js, 9, 3), Decl(global.js, 9, 25)) @@ -86,31 +96,37 @@ ->F4.staticProp : Symbol(F4.staticProp, Decl(global.js, 9, 25)) ->F4 : Symbol(F4, Decl(global.js, 9, 3), Decl(global.js, 9, 25)) ->staticProp : Symbol(F4.staticProp, Decl(global.js, 9, 25)) ++>F4.staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) +>F4 : Symbol(F4, Decl(global.js, 9, 3)) ++>staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) === b.ts === import * as a from "./a"; -@@= skipped -73, +61 lines =@@ +@@= skipped -73, +73 lines =@@ var n = a.C1.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) ->a.C1.staticProp : Symbol(a.C1.staticProp, Decl(a.js, 0, 19)) ->a.C1 : Symbol(a.C1, Decl(a.js, 0, 0), Decl(a.js, 0, 19)) ++>a.C1.staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) +>a.C1 : Symbol(C1, Decl(a.js, 0, 0)) >a : Symbol(a, Decl(b.ts, 0, 6)) ->C1 : Symbol(a.C1, Decl(a.js, 0, 0), Decl(a.js, 0, 19)) ->staticProp : Symbol(a.C1.staticProp, Decl(a.js, 0, 19)) +>C1 : Symbol(C1, Decl(a.js, 0, 0)) ++>staticProp : Symbol(staticProp, Decl(a.js, 0, 19)) var n = a.C2.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) ->a.C2.staticProp : Symbol(a.C2.staticProp, Decl(a.js, 6, 26)) ->a.C2 : Symbol(a.C2, Decl(a.js, 6, 10), Decl(a.js, 6, 26)) ++>a.C2.staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) +>a.C2 : Symbol(C2, Decl(a.js, 6, 10)) >a : Symbol(a, Decl(b.ts, 0, 6)) ->C2 : Symbol(a.C2, Decl(a.js, 6, 10), Decl(a.js, 6, 26)) ->staticProp : Symbol(a.C2.staticProp, Decl(a.js, 6, 26)) +>C2 : Symbol(C2, Decl(a.js, 6, 10)) ++>staticProp : Symbol(staticProp, Decl(a.js, 6, 26)) var n = a.F1.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) @@ -128,11 +144,13 @@ >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) ->a.F2.staticProp : Symbol(a.F2.staticProp, Decl(a.js, 9, 32)) ->a.F2 : Symbol(a.F2, Decl(a.js, 9, 10), Decl(a.js, 9, 32)) ++>a.F2.staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) +>a.F2 : Symbol(F2, Decl(a.js, 9, 10)) >a : Symbol(a, Decl(b.ts, 0, 6)) ->F2 : Symbol(a.F2, Decl(a.js, 9, 10), Decl(a.js, 9, 32)) ->staticProp : Symbol(a.F2.staticProp, Decl(a.js, 9, 32)) +>F2 : Symbol(F2, Decl(a.js, 9, 10)) ++>staticProp : Symbol(staticProp, Decl(a.js, 9, 32)) var n = C3.staticProp; @@ -140,14 +158,18 @@ ->C3.staticProp : Symbol(C3.staticProp, Decl(global.js, 0, 12)) ->C3 : Symbol(C3, Decl(global.js, 0, 0), Decl(global.js, 0, 12)) ->staticProp : Symbol(C3.staticProp, Decl(global.js, 0, 12)) ++>C3.staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) +>C3 : Symbol(C3, Decl(global.js, 0, 0)) ++>staticProp : Symbol(staticProp, Decl(global.js, 0, 12)) var n = C4.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) ->C4.staticProp : Symbol(C4.staticProp, Decl(global.js, 6, 19)) ->C4 : Symbol(C4, Decl(global.js, 6, 3), Decl(global.js, 6, 19)) ->staticProp : Symbol(C4.staticProp, Decl(global.js, 6, 19)) ++>C4.staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) +>C4 : Symbol(C4, Decl(global.js, 6, 3)) ++>staticProp : Symbol(staticProp, Decl(global.js, 6, 19)) var n = F3.staticProp; >n : Symbol(n, Decl(b.ts, 1, 3), Decl(b.ts, 3, 3), Decl(b.ts, 4, 3), Decl(b.ts, 5, 3), Decl(b.ts, 6, 3) ... and 4 more) @@ -163,4 +185,6 @@ ->F4.staticProp : Symbol(F4.staticProp, Decl(global.js, 9, 25)) ->F4 : Symbol(F4, Decl(global.js, 9, 3), Decl(global.js, 9, 25)) ->staticProp : Symbol(F4.staticProp, Decl(global.js, 9, 25)) ++>F4.staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) +>F4 : Symbol(F4, Decl(global.js, 9, 3)) ++>staticProp : Symbol(staticProp, Decl(global.js, 9, 25)) diff --git a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.types b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.types index 3edaa0fce0..c5c787d1f5 100644 --- a/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.types +++ b/testdata/baselines/reference/submodule/conformance/inferringClassStaticMembersFromAssignments.types @@ -6,9 +6,9 @@ export class C1 { } C1.staticProp = 0; >C1.staticProp = 0 : 0 ->C1.staticProp : any +>C1.staticProp : number >C1 : typeof C1 ->staticProp : any +>staticProp : number >0 : 0 export function F1() { } @@ -27,20 +27,20 @@ export var C2 = class { }; C2.staticProp = 0; >C2.staticProp = 0 : 0 ->C2.staticProp : any +>C2.staticProp : number >C2 : typeof C2 ->staticProp : any +>staticProp : number >0 : 0 export let F2 = function () { }; ->F2 : () => void ->function () { } : () => void +>F2 : { (): void; staticProp: number; } +>function () { } : { (): void; staticProp: number; } F2.staticProp = 0; >F2.staticProp = 0 : 0 ->F2.staticProp : any ->F2 : () => void ->staticProp : any +>F2.staticProp : number +>F2 : { (): void; staticProp: number; } +>staticProp : number >0 : 0 === global.js === @@ -49,9 +49,9 @@ class C3 { } C3.staticProp = 0; >C3.staticProp = 0 : 0 ->C3.staticProp : any +>C3.staticProp : number >C3 : typeof C3 ->staticProp : any +>staticProp : number >0 : 0 function F3() { } @@ -70,20 +70,20 @@ var C4 = class { }; C4.staticProp = 0; >C4.staticProp = 0 : 0 ->C4.staticProp : any +>C4.staticProp : number >C4 : typeof C4 ->staticProp : any +>staticProp : number >0 : 0 let F4 = function () { }; ->F4 : () => void ->function () { } : () => void +>F4 : { (): void; staticProp: number; } +>function () { } : { (): void; staticProp: number; } F4.staticProp = 0; >F4.staticProp = 0 : 0 ->F4.staticProp : any ->F4 : () => void ->staticProp : any +>F4.staticProp : number +>F4 : { (): void; staticProp: number; } +>staticProp : number >0 : 0 === b.ts === @@ -95,19 +95,19 @@ var n: number; var n = a.C1.staticProp; >n : number ->a.C1.staticProp : any +>a.C1.staticProp : number >a.C1 : typeof a.C1 >a : typeof a >C1 : typeof a.C1 ->staticProp : any +>staticProp : number var n = a.C2.staticProp; >n : number ->a.C2.staticProp : any +>a.C2.staticProp : number >a.C2 : typeof C2 >a : typeof a >C2 : typeof C2 ->staticProp : any +>staticProp : number var n = a.F1.staticProp; >n : number @@ -119,24 +119,24 @@ var n = a.F1.staticProp; var n = a.F2.staticProp; >n : number ->a.F2.staticProp : any ->a.F2 : () => void +>a.F2.staticProp : number +>a.F2 : { (): void; staticProp: number; } >a : typeof a ->F2 : () => void ->staticProp : any +>F2 : { (): void; staticProp: number; } +>staticProp : number var n = C3.staticProp; >n : number ->C3.staticProp : any +>C3.staticProp : number >C3 : typeof C3 ->staticProp : any +>staticProp : number var n = C4.staticProp; >n : number ->C4.staticProp : any +>C4.staticProp : number >C4 : typeof C4 ->staticProp : any +>staticProp : number var n = F3.staticProp; >n : number @@ -146,7 +146,7 @@ var n = F3.staticProp; var n = F4.staticProp; >n : number ->F4.staticProp : any ->F4 : () => void ->staticProp : any +>F4.staticProp : number +>F4 : { (): void; staticProp: number; } +>staticProp : number diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.errors.txt b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.errors.txt deleted file mode 100644 index 6b9e3ece32..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -a.js(2,3): error TS2339: Property 'd' does not exist on type '{}'. -b.js(1,3): error TS2339: Property 'd' does not exist on type '{}'. - - -==== a.js (1 errors) ==== - const a = {}; - a.d = function() {}; - ~ -!!! error TS2339: Property 'd' does not exist on type '{}'. -==== b.js (1 errors) ==== - a.d.prototype = {}; - ~ -!!! error TS2339: Property 'd' does not exist on type '{}'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols index 56da98107a..d1d3131843 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols @@ -5,9 +5,15 @@ const a = {}; >a : Symbol(a, Decl(a.js, 0, 5)) a.d = function() {}; +>a.d : Symbol(d, Decl(a.js, 0, 13)) >a : Symbol(a, Decl(a.js, 0, 5)) +>d : Symbol(d, Decl(a.js, 0, 13)) === b.js === a.d.prototype = {}; +>a.d.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>a.d : Symbol(d, Decl(a.js, 0, 13)) >a : Symbol(a, Decl(a.js, 0, 5)) +>d : Symbol(d, Decl(a.js, 0, 13)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols.diff index ab7b0ea708..89d7a19a42 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.symbols.diff @@ -11,7 +11,9 @@ ->a.d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2)) ->a : Symbol(a, Decl(a.js, 0, 5), Decl(a.js, 0, 13), Decl(b.js, 0, 0)) ->d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2)) ++>a.d : Symbol(d, Decl(a.js, 0, 13)) +>a : Symbol(a, Decl(a.js, 0, 5)) ++>d : Symbol(d, Decl(a.js, 0, 13)) === b.js === a.d.prototype = {}; @@ -20,4 +22,8 @@ ->a : Symbol(a, Decl(a.js, 0, 5), Decl(a.js, 0, 13), Decl(b.js, 0, 0)) ->d : Symbol(a.d, Decl(a.js, 0, 13), Decl(b.js, 0, 2)) ->prototype : Symbol(a.d.prototype, Decl(b.js, 0, 0)) ++>a.d.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>a.d : Symbol(d, Decl(a.js, 0, 13)) +>a : Symbol(a, Decl(a.js, 0, 5)) ++>d : Symbol(d, Decl(a.js, 0, 13)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.types b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.types index 4e0307b580..8842881de1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.types +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeJsContainer.types @@ -2,23 +2,23 @@ === a.js === const a = {}; ->a : {} ->{} : {} +>a : { d: () => void; } +>{} : { d: () => void; } a.d = function() {}; >a.d = function() {} : () => void ->a.d : any ->a : {} ->d : any +>a.d : () => void +>a : { d: () => void; } +>d : () => void >function() {} : () => void === b.js === a.d.prototype = {}; >a.d.prototype = {} : {} >a.d.prototype : any ->a.d : any ->a : {} ->d : any +>a.d : () => void +>a : { d: () => void; } +>d : () => void >prototype : any >{} : {} diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.errors.txt b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.errors.txt index 3c517282d4..e2247073ce 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.errors.txt @@ -1,18 +1,15 @@ -a.js(3,3): error TS2339: Property 'a' does not exist on type '() => void'. -b.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '() => void', but here has type 'number'. +b.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ (): void; a: () => void; }', but here has type 'number'. -==== a.js (1 errors) ==== +==== a.js (0 errors) ==== var /*1*/x = function foo() { } x.a = function bar() { - ~ -!!! error TS2339: Property 'a' does not exist on type '() => void'. } ==== b.ts (1 errors) ==== var x = function () { ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '() => void', but here has type 'number'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ (): void; a: () => void; }', but here has type 'number'. !!! related TS6203 a.js:1:10: 'x' was also declared here. return 1; }(); diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols index 1e6317b535..f25f933034 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols @@ -6,7 +6,9 @@ var /*1*/x = function foo() { >foo : Symbol(foo, Decl(a.js, 0, 12)) } x.a = function bar() { +>x.a : Symbol(a, Decl(a.js, 1, 1)) >x : Symbol(x, Decl(a.js, 0, 3), Decl(b.ts, 0, 3)) +>a : Symbol(a, Decl(a.js, 1, 1)) >bar : Symbol(bar, Decl(a.js, 2, 5)) } === b.ts === diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols.diff index 84907c9cf7..9d0927fd20 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.symbols.diff @@ -12,7 +12,9 @@ ->x.a : Symbol(x.a, Decl(a.js, 1, 1)) ->x : Symbol(x, Decl(a.js, 0, 3), Decl(a.js, 1, 1), Decl(b.ts, 0, 3)) ->a : Symbol(x.a, Decl(a.js, 1, 1)) ++>x.a : Symbol(a, Decl(a.js, 1, 1)) +>x : Symbol(x, Decl(a.js, 0, 3), Decl(b.ts, 0, 3)) ++>a : Symbol(a, Decl(a.js, 1, 1)) >bar : Symbol(bar, Decl(a.js, 2, 5)) } === b.ts === diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.types b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.types index cf19de2076..715910092b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.types +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration.types @@ -2,21 +2,21 @@ === a.js === var /*1*/x = function foo() { ->x : () => void ->function foo() {} : () => void ->foo : () => void +>x : { (): void; a: () => void; } +>function foo() {} : { (): void; a: () => void; } +>foo : { (): void; a: () => void; } } x.a = function bar() { >x.a = function bar() {} : () => void ->x.a : any ->x : () => void ->a : any +>x.a : () => void +>x : { (): void; a: () => void; } +>a : () => void >function bar() {} : () => void >bar : () => void } === b.ts === var x = function () { ->x : () => void +>x : { (): void; a: () => void; } >function () { return 1;}() : number >function () { return 1;} : () => number diff --git a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration3.types b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration3.types index 7860165d15..6cb8970fe7 100644 --- a/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration3.types +++ b/testdata/baselines/reference/submodule/conformance/jsContainerMergeTsDeclaration3.types @@ -6,8 +6,8 @@ declare class A {} === b.js === const A = { }; ->A : {} ->{ } : {} +>A : { d: {}; } +>{ } : { d: {}; } A.d = { }; >A.d = { } : {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.errors.txt index 2ca0a233f5..57d5ec44df 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.errors.txt @@ -7,12 +7,11 @@ jsDeclarationsClassMethod.js(29,30): error TS7006: Parameter 'y' implicitly has jsDeclarationsClassMethod.js(51,14): error TS2551: Property 'method2' does not exist on type 'C2'. Did you mean 'method1'? jsDeclarationsClassMethod.js(51,34): error TS7006: Parameter 'x' implicitly has an 'any' type. jsDeclarationsClassMethod.js(51,37): error TS7006: Parameter 'y' implicitly has an 'any' type. -jsDeclarationsClassMethod.js(61,4): error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. jsDeclarationsClassMethod.js(61,27): error TS7006: Parameter 'x' implicitly has an 'any' type. jsDeclarationsClassMethod.js(61,30): error TS7006: Parameter 'y' implicitly has an 'any' type. -==== jsDeclarationsClassMethod.js (12 errors) ==== +==== jsDeclarationsClassMethod.js (11 errors) ==== function C1() { /** * A comment prop @@ -93,8 +92,6 @@ jsDeclarationsClassMethod.js(61,30): error TS7006: Parameter 'y' implicitly has * @returns {number} */ C2.staticProp = function (x, y) { - ~~~~~~~~~~ -!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. ~ !!! error TS7006: Parameter 'x' implicitly has an 'any' type. ~ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols index e0eb649939..606e6d8ce4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols @@ -101,7 +101,9 @@ C2.prototype.method2 = function (x, y) { * @returns {number} */ C2.staticProp = function (x, y) { +>C2.staticProp : Symbol(staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) >C2 : Symbol(C2, Decl(jsDeclarationsClassMethod.js, 30, 1)) +>staticProp : Symbol(staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) >x : Symbol(x, Decl(jsDeclarationsClassMethod.js, 60, 26)) >y : Symbol(y, Decl(jsDeclarationsClassMethod.js, 60, 28)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols.diff index 530700d41d..6ad116fd4c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.symbols.diff @@ -86,6 +86,8 @@ ->C2.staticProp : Symbol(C2.staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) ->C2 : Symbol(C2, Decl(jsDeclarationsClassMethod.js, 30, 1), Decl(jsDeclarationsClassMethod.js, 52, 1)) ->staticProp : Symbol(C2.staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) ++>C2.staticProp : Symbol(staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) +>C2 : Symbol(C2, Decl(jsDeclarationsClassMethod.js, 30, 1)) ++>staticProp : Symbol(staticProp, Decl(jsDeclarationsClassMethod.js, 52, 1)) >x : Symbol(x, Decl(jsDeclarationsClassMethod.js, 60, 26)) >y : Symbol(y, Decl(jsDeclarationsClassMethod.js, 60, 28)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.types index 2ebdc39cc9..3bde44e8b9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassMethod.types @@ -122,9 +122,9 @@ C2.prototype.method2 = function (x, y) { */ C2.staticProp = function (x, y) { >C2.staticProp = function (x, y) { return x + y;} : (x: any, y: any) => any ->C2.staticProp : any +>C2.staticProp : (x: any, y: any) => any >C2 : typeof C2 ->staticProp : any +>staticProp : (x: any, y: any) => any >function (x, y) { return x + y;} : (x: any, y: any) => any >x : any >y : any diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt index ca8208ac52..40716a87f1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt @@ -1,9 +1,8 @@ -source.js(9,9): error TS2339: Property 'statische' does not exist on type 'typeof Handler'. source.js(15,1): error TS2309: An export assignment cannot be used in a module with other exported elements. source.js(16,16): error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. -==== source.js (3 errors) ==== +==== source.js (2 errors) ==== class Handler { static get OPTIONS() { return 1; @@ -13,8 +12,6 @@ source.js(16,16): error TS2339: Property 'Strings' does not exist on type 'typeo } } Handler.statische = function() { } - ~~~~~~~~~ -!!! error TS2339: Property 'statische' does not exist on type 'typeof Handler'. const Strings = { a: "A", b: "B" diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols index 899a405f27..1ac50eb1ca 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols @@ -15,7 +15,9 @@ class Handler { } } Handler.statische = function() { } +>Handler.statische : Symbol(statische, Decl(source.js, 7, 1)) >Handler : Symbol(Handler, Decl(source.js, 0, 0)) +>statische : Symbol(statische, Decl(source.js, 7, 1)) const Strings = { >Strings : Symbol(Strings, Decl(source.js, 9, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff index 580d0f52a0..073884c653 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff @@ -23,11 +23,13 @@ ->Handler.statische : Symbol(Handler.statische, Decl(source.js, 7, 1)) ->Handler : Symbol(Handler, Decl(source.js, 0, 0), Decl(source.js, 7, 1)) ->statische : Symbol(Handler.statische, Decl(source.js, 7, 1)) ++>Handler.statische : Symbol(statische, Decl(source.js, 7, 1)) +>Handler : Symbol(Handler, Decl(source.js, 0, 0)) ++>statische : Symbol(statische, Decl(source.js, 7, 1)) const Strings = { >Strings : Symbol(Strings, Decl(source.js, 9, 5)) -@@= skipped -28, +26 lines =@@ +@@= skipped -28, +28 lines =@@ } module.exports = Handler; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types index 732245046e..3901dc7659 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types @@ -17,9 +17,9 @@ class Handler { } Handler.statische = function() { } >Handler.statische = function() { } : () => void ->Handler.statische : any +>Handler.statische : () => void >Handler : typeof Handler ->statische : any +>statische : () => void >function() { } : () => void const Strings = { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols index 941d8a1b39..f84c2e4aa1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols @@ -12,9 +12,9 @@ export class Foo extends Base {} >Base : Symbol(Base, Decl(Foo.js, 0, 0)) Foo.foo = "foo"; ->Foo.foo : Symbol(foo, Decl(Foo.js, 0, 12)) +>Foo.foo : Symbol(foo, Decl(Foo.js, 3, 32)) >Foo : Symbol(Foo, Decl(Foo.js, 2, 1)) ->foo : Symbol(foo, Decl(Foo.js, 0, 12)) +>foo : Symbol(foo, Decl(Foo.js, 3, 32)) === Bar.ts === import { Foo } from "./Foo.js"; @@ -25,7 +25,7 @@ class Bar extends Foo {} >Foo : Symbol(Foo, Decl(Bar.ts, 0, 8)) Bar.foo = "foo"; ->Bar.foo : Symbol(foo, Decl(Foo.js, 0, 12)) +>Bar.foo : Symbol(foo, Decl(Foo.js, 3, 32)) >Bar : Symbol(Bar, Decl(Bar.ts, 0, 31)) ->foo : Symbol(foo, Decl(Foo.js, 0, 12)) +>foo : Symbol(foo, Decl(Foo.js, 3, 32)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols.diff index d5635c1824..5a1e0dd915 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic2.symbols.diff @@ -16,9 +16,9 @@ ->Foo.foo : Symbol(Foo.foo, Decl(Foo.js, 3, 32)) ->Foo : Symbol(Foo, Decl(Foo.js, 2, 1), Decl(Foo.js, 3, 32)) ->foo : Symbol(Foo.foo, Decl(Foo.js, 3, 32)) -+>Foo.foo : Symbol(foo, Decl(Foo.js, 0, 12)) ++>Foo.foo : Symbol(foo, Decl(Foo.js, 3, 32)) +>Foo : Symbol(Foo, Decl(Foo.js, 2, 1)) -+>foo : Symbol(foo, Decl(Foo.js, 0, 12)) ++>foo : Symbol(foo, Decl(Foo.js, 3, 32)) === Bar.ts === import { Foo } from "./Foo.js"; @@ -27,7 +27,7 @@ Bar.foo = "foo"; ->Bar.foo : Symbol(Foo.foo, Decl(Foo.js, 3, 32)) -+>Bar.foo : Symbol(foo, Decl(Foo.js, 0, 12)) ++>Bar.foo : Symbol(foo, Decl(Foo.js, 3, 32)) >Bar : Symbol(Bar, Decl(Bar.ts, 0, 31)) ->foo : Symbol(Foo.foo, Decl(Foo.js, 3, 32)) -+>foo : Symbol(foo, Decl(Foo.js, 0, 12)) ++>foo : Symbol(foo, Decl(Foo.js, 3, 32)) diff --git a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.errors.txt b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.errors.txt index 4df6082227..8121c8945a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.errors.txt @@ -1,5 +1,3 @@ -b.ts(1,10): error TS2339: Property 'a' does not exist on type '{}'. -b.ts(2,18): error TS2339: Property 'a' does not exist on type '{}'. b.ts(3,29): error TS2339: Property 'a' does not exist on type '{}'. b.ts(4,14): error TS2339: Property 'a' does not exist on type '{}'. b.ts(5,8): error TS2339: Property 'a' does not exist on type '{}'. @@ -31,13 +29,9 @@ b.ts(6,10): error TS2339: Property 'a' does not exist on type '{}'. } -==== b.ts (6 errors) ==== +==== b.ts (4 errors) ==== variable.a = 1; - ~ -!!! error TS2339: Property 'a' does not exist on type '{}'. (new C()).member.a = 1; - ~ -!!! error TS2339: Property 'a' does not exist on type '{}'. (new C()).initializedMember.a = 1; ~ !!! error TS2339: Property 'a' does not exist on type '{}'. diff --git a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols index 442679b339..ad85f14b51 100644 --- a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols @@ -5,7 +5,9 @@ var variable = {}; >variable : Symbol(variable, Decl(a.js, 0, 3)) variable.a = 0; +>variable.a : Symbol(a, Decl(a.js, 0, 18)) >variable : Symbol(variable, Decl(a.js, 0, 3)) +>a : Symbol(a, Decl(a.js, 0, 18)) class C { >C : Symbol(C, Decl(a.js, 1, 15)) @@ -20,9 +22,11 @@ class C { >member : Symbol(member, Decl(a.js, 5, 19)) this.member.a = 0; +>this.member.a : Symbol(a, Decl(a.js, 6, 25)) >this.member : Symbol(member, Decl(a.js, 5, 19)) >this : Symbol(C, Decl(a.js, 1, 15)) >member : Symbol(member, Decl(a.js, 5, 19)) +>a : Symbol(a, Decl(a.js, 6, 25)) } } @@ -51,12 +55,16 @@ function getObj() { === b.ts === variable.a = 1; +>variable.a : Symbol(a, Decl(a.js, 0, 18)) >variable : Symbol(variable, Decl(a.js, 0, 3)) +>a : Symbol(a, Decl(a.js, 0, 18)) (new C()).member.a = 1; +>(new C()).member.a : Symbol(a, Decl(a.js, 6, 25)) >(new C()).member : Symbol(member, Decl(a.js, 5, 19)) >C : Symbol(C, Decl(a.js, 1, 15)) >member : Symbol(member, Decl(a.js, 5, 19)) +>a : Symbol(a, Decl(a.js, 6, 25)) (new C()).initializedMember.a = 1; >(new C()).initializedMember : Symbol(initializedMember, Decl(a.js, 3, 9)) diff --git a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols.diff index bba4c28e45..a49a29b24c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.symbols.diff @@ -11,7 +11,9 @@ ->variable.a : Symbol(variable.a, Decl(a.js, 0, 18)) ->variable : Symbol(variable, Decl(a.js, 0, 3), Decl(a.js, 0, 18)) ->a : Symbol(variable.a, Decl(a.js, 0, 18)) ++>variable.a : Symbol(a, Decl(a.js, 0, 18)) +>variable : Symbol(variable, Decl(a.js, 0, 3)) ++>a : Symbol(a, Decl(a.js, 0, 18)) class C { >C : Symbol(C, Decl(a.js, 1, 15)) @@ -30,10 +32,12 @@ this.member.a = 0; ->this.member : Symbol(C.member, Decl(a.js, 5, 19)) ++>this.member.a : Symbol(a, Decl(a.js, 6, 25)) +>this.member : Symbol(member, Decl(a.js, 5, 19)) >this : Symbol(C, Decl(a.js, 1, 15)) ->member : Symbol(C.member, Decl(a.js, 5, 19)) +>member : Symbol(member, Decl(a.js, 5, 19)) ++>a : Symbol(a, Decl(a.js, 6, 25)) } } @@ -43,7 +47,7 @@ property: {} >property : Symbol(property, Decl(a.js, 11, 11)) -@@= skipped -36, +34 lines =@@ +@@= skipped -36, +38 lines =@@ obj.property.a = 0; >obj.property : Symbol(property, Decl(a.js, 11, 11)) @@ -59,14 +63,18 @@ ->variable.a : Symbol(variable.a, Decl(a.js, 0, 18)) ->variable : Symbol(variable, Decl(a.js, 0, 3), Decl(a.js, 0, 18)) ->a : Symbol(variable.a, Decl(a.js, 0, 18)) ++>variable.a : Symbol(a, Decl(a.js, 0, 18)) +>variable : Symbol(variable, Decl(a.js, 0, 3)) ++>a : Symbol(a, Decl(a.js, 0, 18)) (new C()).member.a = 1; ->(new C()).member : Symbol(C.member, Decl(a.js, 5, 19)) ++>(new C()).member.a : Symbol(a, Decl(a.js, 6, 25)) +>(new C()).member : Symbol(member, Decl(a.js, 5, 19)) >C : Symbol(C, Decl(a.js, 1, 15)) ->member : Symbol(C.member, Decl(a.js, 5, 19)) +>member : Symbol(member, Decl(a.js, 5, 19)) ++>a : Symbol(a, Decl(a.js, 6, 25)) (new C()).initializedMember.a = 1; ->(new C()).initializedMember : Symbol(C.initializedMember, Decl(a.js, 3, 9)) diff --git a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.types b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.types index 59bea220ae..060d105ebb 100644 --- a/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.types +++ b/testdata/baselines/reference/submodule/conformance/jsObjectsMarkedAsOpenEnded.types @@ -2,14 +2,14 @@ === a.js === var variable = {}; ->variable : {} ->{} : {} +>variable : { a: number; } +>{} : { a: number; } variable.a = 0; >variable.a = 0 : 0 ->variable.a : any ->variable : {} ->a : any +>variable.a : number +>variable : { a: number; } +>a : number >0 : 0 class C { @@ -21,19 +21,19 @@ class C { constructor() { this.member = {}; ->this.member = {} : {} ->this.member : {} +>this.member = {} : { a: number; } +>this.member : { a: number; } >this : this ->member : {} ->{} : {} +>member : { a: number; } +>{} : { a: number; } this.member.a = 0; >this.member.a = 0 : 0 ->this.member.a : any ->this.member : {} +>this.member.a : number +>this.member : { a: number; } >this : this ->member : {} ->a : any +>member : { a: number; } +>a : number >0 : 0 } } @@ -73,20 +73,20 @@ function getObj() { === b.ts === variable.a = 1; >variable.a = 1 : 1 ->variable.a : any ->variable : {} ->a : any +>variable.a : number +>variable : { a: number; } +>a : number >1 : 1 (new C()).member.a = 1; >(new C()).member.a = 1 : 1 ->(new C()).member.a : any ->(new C()).member : {} +>(new C()).member.a : number +>(new C()).member : { a: number; } >(new C()) : C >new C() : C >C : typeof C ->member : {} ->a : any +>member : { a: number; } +>a : number >1 : 1 (new C()).initializedMember.a = 1; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.errors.txt deleted file mode 100644 index f4862136ae..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.errors.txt +++ /dev/null @@ -1,61 +0,0 @@ -/a.js(23,4): error TS2339: Property 'C1' does not exist on type '{}'. -/a.js(47,4): error TS2339: Property 'C5' does not exist on type '{}'. - - -==== /a.js (2 errors) ==== - class A { - /** @return {number} */ - method() { throw new Error(); } - } - /** @implements {A} */ - class B { - method() { return 0 } - } - - /** @implements A */ - class B2 { - /** @return {string} */ - method() { return "" } - } - - /** @implements {A} */ - class B3 { - } - - - var Ns = {}; - /** @implements {A} */ - Ns.C1 = class { - ~~ -!!! error TS2339: Property 'C1' does not exist on type '{}'. - method() { return 11; } - } - /** @implements {A} */ - var C2 = class { - method() { return 12; } - } - var o = { - /** @implements {A} */ - C3: class { - method() { return 13; } - } - } - class CC { - /** @implements {A} */ - C4 = class { - method() { - return 14; - } - } - } - - var C5; - /** @implements {A} */ - Ns.C5 = C5 || class { - ~~ -!!! error TS2339: Property 'C5' does not exist on type '{}'. - method() { - return 15; - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols index cdd2d7481a..1b2f1469d3 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols @@ -37,7 +37,9 @@ var Ns = {}; /** @implements {A} */ Ns.C1 = class { +>Ns.C1 : Symbol(C1, Decl(a.js, 20, 12)) >Ns : Symbol(Ns, Decl(a.js, 20, 3)) +>C1 : Symbol(C1, Decl(a.js, 20, 12)) method() { return 11; } >method : Symbol(method, Decl(a.js, 22, 15)) @@ -80,7 +82,9 @@ var C5; /** @implements {A} */ Ns.C5 = C5 || class { +>Ns.C5 : Symbol(C5, Decl(a.js, 44, 7)) >Ns : Symbol(Ns, Decl(a.js, 20, 3)) +>C5 : Symbol(C5, Decl(a.js, 44, 7)) >C5 : Symbol(C5, Decl(a.js, 44, 3)) method() { diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols.diff index 4a718d9639..5882627540 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.symbols.diff @@ -39,7 +39,9 @@ ->Ns.C1 : Symbol(Ns.C1, Decl(a.js, 20, 12)) ->Ns : Symbol(Ns, Decl(a.js, 20, 3), Decl(a.js, 20, 12), Decl(a.js, 44, 7)) ->C1 : Symbol(Ns.C1, Decl(a.js, 20, 12)) ++>Ns.C1 : Symbol(C1, Decl(a.js, 20, 12)) +>Ns : Symbol(Ns, Decl(a.js, 20, 3)) ++>C1 : Symbol(C1, Decl(a.js, 20, 12)) method() { return 11; } ->method : Symbol(C1.method, Decl(a.js, 22, 15)) @@ -55,7 +57,7 @@ } var o = { >o : Symbol(o, Decl(a.js, 29, 3)) -@@= skipped -26, +24 lines =@@ +@@= skipped -26, +26 lines =@@ >C3 : Symbol(C3, Decl(a.js, 29, 9)) method() { return 13; } @@ -84,7 +86,9 @@ ->Ns.C5 : Symbol(Ns.C5, Decl(a.js, 44, 7)) ->Ns : Symbol(Ns, Decl(a.js, 20, 3), Decl(a.js, 20, 12), Decl(a.js, 44, 7)) ->C5 : Symbol(Ns.C5, Decl(a.js, 44, 7)) ++>Ns.C5 : Symbol(C5, Decl(a.js, 44, 7)) +>Ns : Symbol(Ns, Decl(a.js, 20, 3)) ++>C5 : Symbol(C5, Decl(a.js, 44, 7)) >C5 : Symbol(C5, Decl(a.js, 44, 3)) method() { diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.types b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.types index e0d94ab856..24babcefed 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocImplements_class.types @@ -36,15 +36,15 @@ class B3 { var Ns = {}; ->Ns : {} ->{} : {} +>Ns : { C1: typeof C1; C5: any; } +>{} : { C1: typeof C1; C5: any; } /** @implements {A} */ Ns.C1 = class { >Ns.C1 = class { method() { return 11; }} : typeof C1 ->Ns.C1 : any ->Ns : {} ->C1 : any +>Ns.C1 : typeof C1 +>Ns : { C1: typeof C1; C5: any; } +>C1 : typeof C1 >class { method() { return 11; }} : typeof C1 method() { return 11; } @@ -98,7 +98,7 @@ var C5; Ns.C5 = C5 || class { >Ns.C5 = C5 || class { method() { return 15; }} : any >Ns.C5 : any ->Ns : {} +>Ns : { C1: typeof C1; C5: any; } >C5 : any >C5 || class { method() { return 15; }} : any >C5 : any diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt index b46ac506c2..d2b24c929c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.errors.txt @@ -4,15 +4,13 @@ a.js(16,36): error TS7006: Parameter 'key' implicitly has an 'any' type. a.js(27,16): error TS2315: Type 'Object' is not generic. a.js(28,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(35,37): error TS7006: Parameter 'key' implicitly has an 'any' type. -a.js(46,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. a.js(47,16): error TS2315: Type 'Object' is not generic. a.js(47,31): error TS2304: Cannot find name 'V'. -a.js(48,10): error TS2339: Property '_map' does not exist on type '{}'. -a.js(55,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. +a.js(48,10): error TS2339: Property '_map' does not exist on type '{ Multimap3: () => void; }'. a.js(55,40): error TS7006: Parameter 'key' implicitly has an 'any' type. -==== a.js (12 errors) ==== +==== a.js (10 errors) ==== /** * Should work for function declarations * @constructor @@ -71,8 +69,6 @@ a.js(55,40): error TS7006: Parameter 'key' implicitly has an 'any' type. * @template V */ Ns.Multimap3 = function() { - ~~~~~~~~~ -!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. /** @type {Object} TODO: Remove the prototype from the fresh object */ ~~~~~~~~~~~~~~~~~ !!! error TS2315: Type 'Object' is not generic. @@ -80,7 +76,7 @@ a.js(55,40): error TS7006: Parameter 'key' implicitly has an 'any' type. !!! error TS2304: Cannot find name 'V'. this._map = {}; ~~~~ -!!! error TS2339: Property '_map' does not exist on type '{}'. +!!! error TS2339: Property '_map' does not exist on type '{ Multimap3: () => void; }'. }; /** @@ -88,8 +84,6 @@ a.js(55,40): error TS7006: Parameter 'key' implicitly has an 'any' type. * @returns {V} the value ok */ Ns.Multimap3.prototype.get = function (key) { - ~~~~~~~~~ -!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. ~~~ !!! error TS7006: Parameter 'key' implicitly has an 'any' type. return this._map[key + '']; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols index 6744af4c87..cf41e25cc0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols @@ -65,7 +65,9 @@ var Ns = {}; * @template V */ Ns.Multimap3 = function() { +>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) >Ns : Symbol(Ns, Decl(a.js, 38, 3)) +>Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -78,7 +80,11 @@ Ns.Multimap3 = function() { * @returns {V} the value ok */ Ns.Multimap3.prototype.get = function (key) { +>Ns.Multimap3.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) >Ns : Symbol(Ns, Decl(a.js, 38, 3)) +>Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) >key : Symbol(key, Decl(a.js, 54, 39)) return this._map[key + '']; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols.diff index b083128108..257e3aa308 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.symbols.diff @@ -73,7 +73,9 @@ ->Ns.Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 38, 12)) ->Ns : Symbol(Ns, Decl(a.js, 38, 3), Decl(a.js, 38, 12)) ->Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 38, 12)) ++>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) +>Ns : Symbol(Ns, Decl(a.js, 38, 3)) ++>Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -84,7 +86,7 @@ }; -@@= skipped -17, +13 lines =@@ +@@= skipped -17, +15 lines =@@ * @returns {V} the value ok */ Ns.Multimap3.prototype.get = function (key) { @@ -94,7 +96,11 @@ ->Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 38, 12)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->get : Symbol(Ns.Multimap3.get, Decl(a.js, 48, 2)) ++>Ns.Multimap3.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) +>Ns : Symbol(Ns, Decl(a.js, 38, 3)) ++>Multimap3 : Symbol(Multimap3, Decl(a.js, 38, 12)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) >key : Symbol(key, Decl(a.js, 54, 39)) return this._map[key + '']; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.types b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.types index 52f157ebd5..bc360825f4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag4.types @@ -91,8 +91,8 @@ Multimap2.prototype.get = function (key) { } var Ns = {}; ->Ns : {} ->{} : {} +>Ns : { Multimap3: () => void; } +>{} : { Multimap3: () => void; } /** * Should work for expando-namespaced initialisers too @@ -102,16 +102,16 @@ var Ns = {}; */ Ns.Multimap3 = function() { >Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void ->Ns.Multimap3 : any ->Ns : {} ->Multimap3 : any +>Ns.Multimap3 : () => void +>Ns : { Multimap3: () => void; } +>Multimap3 : () => void >function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; >this._map = {} : any >this._map : any ->this : {} +>this : { Multimap3: () => void; } >_map : any >{} : any >{} : {} @@ -126,9 +126,9 @@ Ns.Multimap3.prototype.get = function (key) { >Ns.Multimap3.prototype.get = function (key) { return this._map[key + ''];} : (key: any) => any >Ns.Multimap3.prototype.get : any >Ns.Multimap3.prototype : any ->Ns.Multimap3 : any ->Ns : {} ->Multimap3 : any +>Ns.Multimap3 : () => void +>Ns : { Multimap3: () => void; } +>Multimap3 : () => void >prototype : any >get : any >function (key) { return this._map[key + ''];} : (key: any) => any diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt index 0a595a052e..0220a0945f 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.errors.txt @@ -7,13 +7,13 @@ a.js(29,16): error TS2315: Type 'Object' is not generic. a.js(30,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(35,16): error TS2304: Cannot find name 'K'. a.js(36,18): error TS2304: Cannot find name 'V'. -a.js(50,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. +a.js(39,21): error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'. a.js(51,16): error TS2315: Type 'Object' is not generic. a.js(51,31): error TS2304: Cannot find name 'V'. -a.js(52,10): error TS2339: Property '_map' does not exist on type '{}'. -a.js(55,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. +a.js(52,10): error TS2339: Property '_map' does not exist on type '{ Multimap3: { (): void; prototype: { get(key: K): V; }; }; }'. a.js(57,16): error TS2304: Cannot find name 'K'. a.js(58,18): error TS2304: Cannot find name 'V'. +a.js(61,21): error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'. ==== a.js (16 errors) ==== @@ -74,6 +74,8 @@ a.js(58,18): error TS2304: Cannot find name 'V'. */ get: function(key) { return this._map[key + '']; + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'. } } @@ -85,8 +87,6 @@ a.js(58,18): error TS2304: Cannot find name 'V'. * @template V */ Ns.Multimap3 = function() { - ~~~~~~~~~ -!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. /** @type {Object} TODO: Remove the prototype from the fresh object */ ~~~~~~~~~~~~~~~~~ !!! error TS2315: Type 'Object' is not generic. @@ -94,12 +94,10 @@ a.js(58,18): error TS2304: Cannot find name 'V'. !!! error TS2304: Cannot find name 'V'. this._map = {}; ~~~~ -!!! error TS2339: Property '_map' does not exist on type '{}'. +!!! error TS2339: Property '_map' does not exist on type '{ Multimap3: { (): void; prototype: { get(key: K): V; }; }; }'. }; Ns.Multimap3.prototype = { - ~~~~~~~~~ -!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. /** * @param {K} key the key ok ~ @@ -110,6 +108,8 @@ a.js(58,18): error TS2304: Cannot find name 'V'. */ get(key) { return this._map[key + '']; + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'. } } diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols index 45522550a4..cd3b0bc09b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols @@ -47,9 +47,9 @@ var Multimap2 = function() { }; Multimap2.prototype = { ->Multimap2.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Multimap2.prototype : Symbol(prototype, Decl(a.js, 30, 2)) >Multimap2 : Symbol(Multimap2, Decl(a.js, 27, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(a.js, 30, 2)) /** * @param {K} key the key ok @@ -60,6 +60,7 @@ Multimap2.prototype = { >key : Symbol(key, Decl(a.js, 37, 18)) return this._map[key + '']; +>this : Symbol(þobject, Decl(a.js, 32, 21)) >key : Symbol(key, Decl(a.js, 37, 18)) } } @@ -74,7 +75,9 @@ var Ns = {}; * @template V */ Ns.Multimap3 = function() { +>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) >Ns : Symbol(Ns, Decl(a.js, 42, 3)) +>Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -83,7 +86,11 @@ Ns.Multimap3 = function() { }; Ns.Multimap3.prototype = { +>Ns.Multimap3.prototype : Symbol(prototype, Decl(a.js, 52, 2)) +>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) >Ns : Symbol(Ns, Decl(a.js, 42, 3)) +>Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) +>prototype : Symbol(prototype, Decl(a.js, 52, 2)) /** * @param {K} key the key ok @@ -94,6 +101,7 @@ Ns.Multimap3.prototype = { >key : Symbol(key, Decl(a.js, 59, 8)) return this._map[key + '']; +>this : Symbol(þobject, Decl(a.js, 54, 24)) >key : Symbol(key, Decl(a.js, 59, 8)) } } diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols.diff index a4f5600a8b..74def6b1bf 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.symbols.diff @@ -55,9 +55,9 @@ ->Multimap2.prototype : Symbol(Multimap2.prototype, Decl(a.js, 30, 2)) ->Multimap2 : Symbol(Multimap2, Decl(a.js, 27, 3), Decl(a.js, 30, 2)) ->prototype : Symbol(Multimap2.prototype, Decl(a.js, 30, 2)) -+>Multimap2.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Multimap2.prototype : Symbol(prototype, Decl(a.js, 30, 2)) +>Multimap2 : Symbol(Multimap2, Decl(a.js, 27, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(a.js, 30, 2)) /** * @param {K} key the key ok @@ -68,6 +68,7 @@ ->this._map : Symbol(Multimap2._map, Decl(a.js, 27, 28)) ->this : Symbol(Multimap2, Decl(a.js, 27, 15)) ->_map : Symbol(Multimap2._map, Decl(a.js, 27, 28)) ++>this : Symbol(þobject, Decl(a.js, 32, 21)) >key : Symbol(key, Decl(a.js, 37, 18)) } } @@ -78,14 +79,16 @@ /** * Should work for expando-namespaced initialisers too -@@= skipped -17, +14 lines =@@ +@@= skipped -17, +15 lines =@@ * @template V */ Ns.Multimap3 = function() { ->Ns.Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 42, 12), Decl(a.js, 54, 3)) ->Ns : Symbol(Ns, Decl(a.js, 42, 3), Decl(a.js, 42, 12), Decl(a.js, 52, 2)) ->Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 42, 12), Decl(a.js, 54, 3)) ++>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) +>Ns : Symbol(Ns, Decl(a.js, 42, 3)) ++>Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -102,17 +105,22 @@ ->Ns : Symbol(Ns, Decl(a.js, 42, 3), Decl(a.js, 42, 12), Decl(a.js, 52, 2)) ->Multimap3 : Symbol(Ns.Multimap3, Decl(a.js, 42, 12), Decl(a.js, 54, 3)) ->prototype : Symbol(Ns.Multimap3.prototype, Decl(a.js, 52, 2)) ++>Ns.Multimap3.prototype : Symbol(prototype, Decl(a.js, 52, 2)) ++>Ns.Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) +>Ns : Symbol(Ns, Decl(a.js, 42, 3)) ++>Multimap3 : Symbol(Multimap3, Decl(a.js, 42, 12)) ++>prototype : Symbol(prototype, Decl(a.js, 52, 2)) /** * @param {K} key the key ok -@@= skipped -28, +20 lines =@@ +@@= skipped -28, +26 lines =@@ >key : Symbol(key, Decl(a.js, 59, 8)) return this._map[key + '']; ->this._map : Symbol(Multimap3._map, Decl(a.js, 49, 27)) ->this : Symbol(Multimap3, Decl(a.js, 49, 14)) ->_map : Symbol(Multimap3._map, Decl(a.js, 49, 27)) ++>this : Symbol(þobject, Decl(a.js, 54, 24)) >key : Symbol(key, Decl(a.js, 59, 8)) } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.types b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.types index c7499a6723..a44c5da58e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTemplateTag5.types @@ -54,8 +54,8 @@ Multimap.prototype = { * @template V */ var Multimap2 = function() { ->Multimap2 : () => void ->function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void +>Multimap2 : { (): void; prototype: { get: (key: K) => V; }; } +>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get: (key: K) => V; }; } /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -70,9 +70,9 @@ var Multimap2 = function() { Multimap2.prototype = { >Multimap2.prototype = { /** * @param {K} key the key ok * @returns {V} the value ok */ get: function(key) { return this._map[key + '']; }} : { get: (key: K) => V; } ->Multimap2.prototype : any ->Multimap2 : () => void ->prototype : any +>Multimap2.prototype : { get: (key: K) => V; } +>Multimap2 : { (): void; prototype: { get: (key: K) => V; }; } +>prototype : { get: (key: K) => V; } >{ /** * @param {K} key the key ok * @returns {V} the value ok */ get: function(key) { return this._map[key + '']; }} : { get: (key: K) => V; } /** @@ -87,7 +87,7 @@ Multimap2.prototype = { return this._map[key + '']; >this._map[key + ''] : any >this._map : any ->this : any +>this : { get: (key: K) => V; } >_map : any >key + '' : string >key : K @@ -96,8 +96,8 @@ Multimap2.prototype = { } var Ns = {}; ->Ns : {} ->{} : {} +>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } +>{} : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } /** * Should work for expando-namespaced initialisers too @@ -106,17 +106,17 @@ var Ns = {}; * @template V */ Ns.Multimap3 = function() { ->Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void ->Ns.Multimap3 : any ->Ns : {} ->Multimap3 : any ->function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void +>Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get(key: K): V; }; } +>Ns.Multimap3 : { (): void; prototype: { get(key: K): V; }; } +>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } +>Multimap3 : { (): void; prototype: { get(key: K): V; }; } +>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get(key: K): V; }; } /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; >this._map = {} : any >this._map : any ->this : {} +>this : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } >_map : any >{} : any >{} : {} @@ -125,11 +125,11 @@ Ns.Multimap3 = function() { Ns.Multimap3.prototype = { >Ns.Multimap3.prototype = { /** * @param {K} key the key ok * @returns {V} the value ok */ get(key) { return this._map[key + '']; }} : { get(key: K): V; } ->Ns.Multimap3.prototype : any ->Ns.Multimap3 : any ->Ns : {} ->Multimap3 : any ->prototype : any +>Ns.Multimap3.prototype : { get(key: K): V; } +>Ns.Multimap3 : { (): void; prototype: { get(key: K): V; }; } +>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } +>Multimap3 : { (): void; prototype: { get(key: K): V; }; } +>prototype : { get(key: K): V; } >{ /** * @param {K} key the key ok * @returns {V} the value ok */ get(key) { return this._map[key + '']; }} : { get(key: K): V; } /** @@ -143,7 +143,7 @@ Ns.Multimap3.prototype = { return this._map[key + '']; >this._map[key + ''] : any >this._map : any ->this : any +>this : { get(key: K): V; } >_map : any >key + '' : string >key : K diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.errors.txt index a820680442..84eb478f76 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.errors.txt @@ -1,9 +1,7 @@ jsdocTypeReferenceToMergedClass.js(2,12): error TS2503: Cannot find namespace 'Workspace'. -jsdocTypeReferenceToMergedClass.js(6,11): error TS2339: Property 'Project' does not exist on type '{}'. -jsdocTypeReferenceToMergedClass.js(7,11): error TS2339: Property 'Project' does not exist on type '{}'. -==== jsdocTypeReferenceToMergedClass.js (3 errors) ==== +==== jsdocTypeReferenceToMergedClass.js (1 errors) ==== var Workspace = {} /** @type {Workspace.Project} */ ~~~~~~~~~ @@ -12,11 +10,7 @@ jsdocTypeReferenceToMergedClass.js(7,11): error TS2339: Property 'Project' does p.isServiceProject() Workspace.Project = function wp() { } - ~~~~~~~ -!!! error TS2339: Property 'Project' does not exist on type '{}'. Workspace.Project.prototype = { - ~~~~~~~ -!!! error TS2339: Property 'Project' does not exist on type '{}'. isServiceProject() {} } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols index 998b467fd1..4da92aad52 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols @@ -12,11 +12,17 @@ p.isServiceProject() >p : Symbol(p, Decl(jsdocTypeReferenceToMergedClass.js, 2, 3)) Workspace.Project = function wp() { } +>Workspace.Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) >Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3)) +>Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) >wp : Symbol(wp, Decl(jsdocTypeReferenceToMergedClass.js, 5, 19)) Workspace.Project.prototype = { +>Workspace.Project.prototype : Symbol(prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) +>Workspace.Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) >Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3)) +>Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) +>prototype : Symbol(prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) isServiceProject() {} >isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 6, 31)) diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols.diff index 9161f88f3c..715f60cf04 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.symbols.diff @@ -20,7 +20,9 @@ ->Workspace.Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10)) ->Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3), Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) ->Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10)) ++>Workspace.Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) +>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3)) ++>Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) >wp : Symbol(wp, Decl(jsdocTypeReferenceToMergedClass.js, 5, 19)) Workspace.Project.prototype = { @@ -29,7 +31,11 @@ ->Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3), Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) ->Project : Symbol(Workspace.Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20), Decl(jsdocTypeReferenceToMergedClass.js, 6, 10)) ->prototype : Symbol(Workspace.Project.prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) ++>Workspace.Project.prototype : Symbol(prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) ++>Workspace.Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) +>Workspace : Symbol(Workspace, Decl(jsdocTypeReferenceToMergedClass.js, 0, 3)) ++>Project : Symbol(Project, Decl(jsdocTypeReferenceToMergedClass.js, 3, 20)) ++>prototype : Symbol(prototype, Decl(jsdocTypeReferenceToMergedClass.js, 5, 37)) isServiceProject() {} >isServiceProject : Symbol(isServiceProject, Decl(jsdocTypeReferenceToMergedClass.js, 6, 31)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.types index e455e23338..3caab97d5a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToMergedClass.types @@ -2,8 +2,8 @@ === jsdocTypeReferenceToMergedClass.js === var Workspace = {} ->Workspace : {} ->{} : {} +>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } +>{} : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } /** @type {Workspace.Project} */ var p; @@ -16,20 +16,20 @@ p.isServiceProject() >isServiceProject : any Workspace.Project = function wp() { } ->Workspace.Project = function wp() { } : () => void ->Workspace.Project : any ->Workspace : {} ->Project : any ->function wp() { } : () => void ->wp : () => void +>Workspace.Project = function wp() { } : { (): void; prototype: { isServiceProject(): void; }; } +>Workspace.Project : { (): void; prototype: { isServiceProject(): void; }; } +>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } +>Project : { (): void; prototype: { isServiceProject(): void; }; } +>function wp() { } : { (): void; prototype: { isServiceProject(): void; }; } +>wp : { (): void; prototype: { isServiceProject(): void; }; } Workspace.Project.prototype = { >Workspace.Project.prototype = { isServiceProject() {}} : { isServiceProject(): void; } ->Workspace.Project.prototype : any ->Workspace.Project : any ->Workspace : {} ->Project : any ->prototype : any +>Workspace.Project.prototype : { isServiceProject(): void; } +>Workspace.Project : { (): void; prototype: { isServiceProject(): void; }; } +>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } +>Project : { (): void; prototype: { isServiceProject(): void; }; } +>prototype : { isServiceProject(): void; } >{ isServiceProject() {}} : { isServiceProject(): void; } isServiceProject() {} diff --git a/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols b/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols index bbc5fb512a..69d2672fad 100644 --- a/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols +++ b/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols @@ -22,9 +22,9 @@ class B { } >B : Symbol(B, Decl(privateNameJsPrototype.js, 5, 1)) B.prototype = { ->B.prototype : Symbol(prototype) +>B.prototype : Symbol(prototype, Decl(privateNameJsPrototype.js, 6, 11)) >B : Symbol(B, Decl(privateNameJsPrototype.js, 5, 1)) ->prototype : Symbol(prototype) +>prototype : Symbol(prototype, Decl(privateNameJsPrototype.js, 6, 11)) #y: 2, // Error >#y : Symbol(#y, Decl(privateNameJsPrototype.js, 7, 15)) diff --git a/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols.diff b/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols.diff index 06dce8e9cc..fad9f92edb 100644 --- a/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/privateNameJsBadDeclaration.symbols.diff @@ -28,9 +28,9 @@ ->B.prototype : Symbol(B.prototype, Decl(privateNameJsPrototype.js, 6, 11)) ->B : Symbol(B, Decl(privateNameJsPrototype.js, 5, 1), Decl(privateNameJsPrototype.js, 6, 11)) ->prototype : Symbol(B.prototype, Decl(privateNameJsPrototype.js, 6, 11)) -+>B.prototype : Symbol(prototype) ++>B.prototype : Symbol(prototype, Decl(privateNameJsPrototype.js, 6, 11)) +>B : Symbol(B, Decl(privateNameJsPrototype.js, 5, 1)) -+>prototype : Symbol(prototype) ++>prototype : Symbol(prototype, Decl(privateNameJsPrototype.js, 6, 11)) #y: 2, // Error >#y : Symbol(#y, Decl(privateNameJsPrototype.js, 7, 15)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/propertyAssignmentOnParenthesizedNumber.types b/testdata/baselines/reference/submodule/conformance/propertyAssignmentOnParenthesizedNumber.types index 15cf3c3953..29ae4ec492 100644 --- a/testdata/baselines/reference/submodule/conformance/propertyAssignmentOnParenthesizedNumber.types +++ b/testdata/baselines/reference/submodule/conformance/propertyAssignmentOnParenthesizedNumber.types @@ -2,14 +2,14 @@ === bug38934.js === var x = {}; ->x : {} ->{} : {} +>x : { 0: number; } +>{} : { 0: number; } // should not crash and also should not result in a property '0' on x. x[(0)] = 1; >x[(0)] = 1 : 1 ->x[(0)] : any ->x : {} +>x[(0)] : number +>x : { 0: number; } >(0) : 0 >0 : 0 >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt index 29eab95b99..d7cd47b9f3 100644 --- a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt @@ -1,28 +1,16 @@ other.js(2,11): error TS2503: Cannot find namespace 'Ns'. other.js(7,11): error TS2503: Cannot find namespace 'Ns'. -prototypePropertyAssignmentMergeAcrossFiles2.js(2,4): error TS2339: Property 'One' does not exist on type '{}'. -prototypePropertyAssignmentMergeAcrossFiles2.js(3,4): error TS2339: Property 'Two' does not exist on type '{}'. -prototypePropertyAssignmentMergeAcrossFiles2.js(5,4): error TS2339: Property 'One' does not exist on type '{}'. -prototypePropertyAssignmentMergeAcrossFiles2.js(8,4): error TS2339: Property 'Two' does not exist on type '{}'. -==== prototypePropertyAssignmentMergeAcrossFiles2.js (4 errors) ==== +==== prototypePropertyAssignmentMergeAcrossFiles2.js (0 errors) ==== var Ns = {} Ns.One = function() {}; - ~~~ -!!! error TS2339: Property 'One' does not exist on type '{}'. Ns.Two = function() {}; - ~~~ -!!! error TS2339: Property 'Two' does not exist on type '{}'. Ns.One.prototype = { - ~~~ -!!! error TS2339: Property 'One' does not exist on type '{}'. ok() {}, }; Ns.Two.prototype = { - ~~~ -!!! error TS2339: Property 'Two' does not exist on type '{}'. } ==== other.js (2 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols index 413e33cdcc..ff35b4b478 100644 --- a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols +++ b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols @@ -5,20 +5,32 @@ var Ns = {} >Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) Ns.One = function() {}; +>Ns.One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) >Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) +>One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) Ns.Two = function() {}; +>Ns.Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) >Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) +>Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) Ns.One.prototype = { +>Ns.One.prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) +>Ns.One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) >Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) +>One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) +>prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) ok() {}, >ok : Symbol(ok, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 4, 20)) }; Ns.Two.prototype = { +>Ns.Two.prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) +>Ns.Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) >Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) +>Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) +>prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) } === other.js === diff --git a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols.diff b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols.diff index 168f92494e..632af6c977 100644 --- a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.symbols.diff @@ -11,13 +11,17 @@ ->Ns.One : Symbol(Ns.One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 4, 3)) ->Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ->One : Symbol(Ns.One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 4, 3)) ++>Ns.One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) +>Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) ++>One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) Ns.Two = function() {}; ->Ns.Two : Symbol(Ns.Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 7, 3)) ->Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ->Two : Symbol(Ns.Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 7, 3)) ++>Ns.Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) +>Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) ++>Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) Ns.One.prototype = { ->Ns.One.prototype : Symbol(Ns.One.prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) @@ -25,7 +29,11 @@ ->Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ->One : Symbol(Ns.One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 4, 3)) ->prototype : Symbol(Ns.One.prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) ++>Ns.One.prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) ++>Ns.One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) +>Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) ++>One : Symbol(One, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11)) ++>prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23)) ok() {}, >ok : Symbol(ok, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 4, 20)) @@ -37,7 +45,11 @@ ->Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 11), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 2, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ->Two : Symbol(Ns.Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23), Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 7, 3)) ->prototype : Symbol(Ns.Two.prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ++>Ns.Two.prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) ++>Ns.Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) +>Ns : Symbol(Ns, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 0, 3)) ++>Two : Symbol(Two, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 1, 23)) ++>prototype : Symbol(prototype, Decl(prototypePropertyAssignmentMergeAcrossFiles2.js, 6, 2)) } === other.js === \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types index d708063b62..adde15215a 100644 --- a/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types +++ b/testdata/baselines/reference/submodule/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types @@ -2,30 +2,30 @@ === prototypePropertyAssignmentMergeAcrossFiles2.js === var Ns = {} ->Ns : {} ->{} : {} +>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } +>{} : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } Ns.One = function() {}; ->Ns.One = function() {} : () => void ->Ns.One : any ->Ns : {} ->One : any ->function() {} : () => void +>Ns.One = function() {} : { (): void; prototype: { ok(): void; }; } +>Ns.One : { (): void; prototype: { ok(): void; }; } +>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } +>One : { (): void; prototype: { ok(): void; }; } +>function() {} : { (): void; prototype: { ok(): void; }; } Ns.Two = function() {}; ->Ns.Two = function() {} : () => void ->Ns.Two : any ->Ns : {} ->Two : any ->function() {} : () => void +>Ns.Two = function() {} : { (): void; prototype: {}; } +>Ns.Two : { (): void; prototype: {}; } +>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } +>Two : { (): void; prototype: {}; } +>function() {} : { (): void; prototype: {}; } Ns.One.prototype = { >Ns.One.prototype = { ok() {},} : { ok(): void; } ->Ns.One.prototype : any ->Ns.One : any ->Ns : {} ->One : any ->prototype : any +>Ns.One.prototype : { ok(): void; } +>Ns.One : { (): void; prototype: { ok(): void; }; } +>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } +>One : { (): void; prototype: { ok(): void; }; } +>prototype : { ok(): void; } >{ ok() {},} : { ok(): void; } ok() {}, @@ -34,11 +34,11 @@ Ns.One.prototype = { }; Ns.Two.prototype = { >Ns.Two.prototype = {} : {} ->Ns.Two.prototype : any ->Ns.Two : any ->Ns : {} ->Two : any ->prototype : any +>Ns.Two.prototype : {} +>Ns.Two : { (): void; prototype: {}; } +>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } +>Two : { (): void; prototype: {}; } +>prototype : {} >{} : {} } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.errors.txt index 7a0891aa8f..1419e4c079 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.errors.txt @@ -1,15 +1,12 @@ -a.js(4,7): error TS2339: Property 'Inner' does not exist on type 'typeof O'. a.js(8,12): error TS2749: 'Outer' refers to a value, but is being used as a type here. Did you mean 'typeof Outer'? a.js(11,12): error TS2503: Cannot find namespace 'Outer'. -==== a.js (3 errors) ==== +==== a.js (2 errors) ==== var Outer = class O { m(x, y) { } } Outer.Inner = class I { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type 'typeof O'. n(a, b) { } } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols index c26aa4fa38..8571eab4ff 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols @@ -11,7 +11,9 @@ var Outer = class O { >y : Symbol(y, Decl(a.js, 1, 8)) } Outer.Inner = class I { +>Outer.Inner : Symbol(Inner, Decl(a.js, 2, 1)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 2, 1)) >I : Symbol(I, Decl(a.js, 3, 13)) n(a, b) { } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols.diff index 12ddc7b7ba..0a176a5629 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.symbols.diff @@ -18,7 +18,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 2, 1)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 2, 1)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 2, 1)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 2, 1)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 2, 1)) >I : Symbol(I, Decl(a.js, 3, 13)) n(a, b) { } @@ -27,7 +29,7 @@ >a : Symbol(a, Decl(a.js, 4, 6)) >b : Symbol(b, Decl(a.js, 4, 8)) -@@= skipped -25, +23 lines =@@ +@@= skipped -25, +25 lines =@@ >si : Symbol(si, Decl(a.js, 8, 3)) si.m diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.types index ea351c3e55..cce4b2645c 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment.types @@ -13,9 +13,9 @@ var Outer = class O { } Outer.Inner = class I { >Outer.Inner = class I { n(a, b) { }} : typeof I ->Outer.Inner : any +>Outer.Inner : typeof I >Outer : typeof O ->Inner : any +>Inner : typeof I >class I { n(a, b) { }} : typeof I >I : typeof I diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.errors.txt new file mode 100644 index 0000000000..552d29dbc2 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.errors.txt @@ -0,0 +1,24 @@ +module.js(7,17): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. +module.js(9,17): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. + + +==== module.js (2 errors) ==== + var Inner = function() {} + Inner.prototype = { + m() { }, + i: 1 + } + // incremental assignments still work + Inner.prototype.j = 2 + ~ +!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. + /** @type {string} */ + Inner.prototype.k; + ~ +!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. + var inner = new Inner() + inner.m() + inner.i + inner.j + inner.k + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols index 6635af7049..22889a2b3c 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols @@ -5,9 +5,9 @@ var Inner = function() {} >Inner : Symbol(Inner, Decl(module.js, 0, 3)) Inner.prototype = { ->Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) >Inner : Symbol(Inner, Decl(module.js, 0, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(module.js, 0, 25)) m() { }, >m : Symbol(m, Decl(module.js, 1, 19)) @@ -17,15 +17,15 @@ Inner.prototype = { } // incremental assignments still work Inner.prototype.j = 2 ->Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) >Inner : Symbol(Inner, Decl(module.js, 0, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(module.js, 0, 25)) /** @type {string} */ Inner.prototype.k; ->Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) >Inner : Symbol(Inner, Decl(module.js, 0, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(module.js, 0, 25)) var inner = new Inner() >inner : Symbol(inner, Decl(module.js, 9, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols.diff index 0f069a338b..0920e0da5a 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.symbols.diff @@ -11,9 +11,9 @@ ->Inner.prototype : Symbol(Inner.prototype, Decl(module.js, 0, 25)) ->Inner : Symbol(Inner, Decl(module.js, 0, 3), Decl(module.js, 0, 25)) ->prototype : Symbol(Inner.prototype, Decl(module.js, 0, 25)) -+>Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) +>Inner : Symbol(Inner, Decl(module.js, 0, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(module.js, 0, 25)) m() { }, >m : Symbol(m, Decl(module.js, 1, 19)) @@ -25,18 +25,18 @@ ->Inner : Symbol(Inner, Decl(module.js, 0, 3), Decl(module.js, 0, 25)) ->prototype : Symbol(Inner.prototype, Decl(module.js, 0, 25)) ->j : Symbol(Inner.j, Decl(module.js, 4, 1)) -+>Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) +>Inner : Symbol(Inner, Decl(module.js, 0, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(module.js, 0, 25)) /** @type {string} */ Inner.prototype.k; ->Inner.prototype : Symbol(Inner.prototype, Decl(module.js, 0, 25)) ->Inner : Symbol(Inner, Decl(module.js, 0, 3), Decl(module.js, 0, 25)) ->prototype : Symbol(Inner.prototype, Decl(module.js, 0, 25)) -+>Inner.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Inner.prototype : Symbol(prototype, Decl(module.js, 0, 25)) +>Inner : Symbol(Inner, Decl(module.js, 0, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(module.js, 0, 25)) var inner = new Inner() >inner : Symbol(inner, Decl(module.js, 9, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.types index f60f82875d..19f8ed9886 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment11.types @@ -2,14 +2,14 @@ === module.js === var Inner = function() {} ->Inner : () => void ->function() {} : () => void +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>function() {} : { (): void; prototype: { m(): void; i: number; }; } Inner.prototype = { >Inner.prototype = { m() { }, i: 1} : { m(): void; i: number; } ->Inner.prototype : any ->Inner : () => void ->prototype : any +>Inner.prototype : { m(): void; i: number; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >{ m() { }, i: 1} : { m(): void; i: number; } m() { }, @@ -23,24 +23,24 @@ Inner.prototype = { Inner.prototype.j = 2 >Inner.prototype.j = 2 : 2 >Inner.prototype.j : any ->Inner.prototype : any ->Inner : () => void ->prototype : any +>Inner.prototype : { m(): void; i: number; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >j : any >2 : 2 /** @type {string} */ Inner.prototype.k; >Inner.prototype.k : any ->Inner.prototype : any ->Inner : () => void ->prototype : any +>Inner.prototype : { m(): void; i: number; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >k : any var inner = new Inner() >inner : any >new Inner() : any ->Inner : () => void +>Inner : { (): void; prototype: { m(): void; i: number; }; } inner.m() >inner.m() : any diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.errors.txt index 91d02ec605..8546f2ec1e 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.errors.txt @@ -1,32 +1,23 @@ -module.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -module.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. -module.js(8,7): error TS2339: Property 'Inner' does not exist on type '{}'. -module.js(10,7): error TS2339: Property 'Inner' does not exist on type '{}'. -module.js(11,23): error TS2339: Property 'Inner' does not exist on type '{}'. +module.js(8,23): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. +module.js(10,23): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. -==== module.js (5 errors) ==== +==== module.js (2 errors) ==== var Outer = {} Outer.Inner = function() {} - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. Outer.Inner.prototype = { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. m() { }, i: 1 } // incremental assignments still work Outer.Inner.prototype.j = 2 - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. + ~ +!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. /** @type {string} */ Outer.Inner.prototype.k; - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. + ~ +!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. var inner = new Outer.Inner() - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. inner.m() inner.i inner.j diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols index 88a0f90b74..b818ab4c2c 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols @@ -5,10 +5,16 @@ var Outer = {} >Outer : Symbol(Outer, Decl(module.js, 0, 3)) Outer.Inner = function() {} +>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) >Outer : Symbol(Outer, Decl(module.js, 0, 3)) +>Inner : Symbol(Inner, Decl(module.js, 0, 14)) Outer.Inner.prototype = { +>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) +>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) >Outer : Symbol(Outer, Decl(module.js, 0, 3)) +>Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>prototype : Symbol(prototype, Decl(module.js, 1, 27)) m() { }, >m : Symbol(m, Decl(module.js, 2, 25)) @@ -18,15 +24,25 @@ Outer.Inner.prototype = { } // incremental assignments still work Outer.Inner.prototype.j = 2 +>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) +>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) >Outer : Symbol(Outer, Decl(module.js, 0, 3)) +>Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>prototype : Symbol(prototype, Decl(module.js, 1, 27)) /** @type {string} */ Outer.Inner.prototype.k; +>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) +>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) >Outer : Symbol(Outer, Decl(module.js, 0, 3)) +>Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>prototype : Symbol(prototype, Decl(module.js, 1, 27)) var inner = new Outer.Inner() >inner : Symbol(inner, Decl(module.js, 10, 3)) +>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) >Outer : Symbol(Outer, Decl(module.js, 0, 3)) +>Inner : Symbol(Inner, Decl(module.js, 0, 14)) inner.m() >inner : Symbol(inner, Decl(module.js, 10, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols.diff index 17d21f6297..a74b2260bf 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.symbols.diff @@ -11,7 +11,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ->Outer : Symbol(Outer, Decl(module.js, 0, 3), Decl(module.js, 0, 14), Decl(module.js, 1, 27)) ->Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ++>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>Outer : Symbol(Outer, Decl(module.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(module.js, 0, 14)) Outer.Inner.prototype = { ->Outer.Inner.prototype : Symbol(Outer.Inner.prototype, Decl(module.js, 1, 27)) @@ -19,11 +21,15 @@ ->Outer : Symbol(Outer, Decl(module.js, 0, 3), Decl(module.js, 0, 14), Decl(module.js, 1, 27)) ->Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ->prototype : Symbol(Outer.Inner.prototype, Decl(module.js, 1, 27)) ++>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) ++>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>Outer : Symbol(Outer, Decl(module.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(module.js, 0, 14)) ++>prototype : Symbol(prototype, Decl(module.js, 1, 27)) m() { }, >m : Symbol(m, Decl(module.js, 2, 25)) -@@= skipped -22, +16 lines =@@ +@@= skipped -22, +22 lines =@@ } // incremental assignments still work Outer.Inner.prototype.j = 2 @@ -33,7 +39,11 @@ ->Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ->prototype : Symbol(Outer.Inner.prototype, Decl(module.js, 1, 27)) ->j : Symbol(Outer.Inner.j, Decl(module.js, 5, 1)) ++>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) ++>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>Outer : Symbol(Outer, Decl(module.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(module.js, 0, 14)) ++>prototype : Symbol(prototype, Decl(module.js, 1, 27)) /** @type {string} */ Outer.Inner.prototype.k; @@ -42,14 +52,20 @@ ->Outer : Symbol(Outer, Decl(module.js, 0, 3), Decl(module.js, 0, 14), Decl(module.js, 1, 27)) ->Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ->prototype : Symbol(Outer.Inner.prototype, Decl(module.js, 1, 27)) ++>Outer.Inner.prototype : Symbol(prototype, Decl(module.js, 1, 27)) ++>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>Outer : Symbol(Outer, Decl(module.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(module.js, 0, 14)) ++>prototype : Symbol(prototype, Decl(module.js, 1, 27)) var inner = new Outer.Inner() >inner : Symbol(inner, Decl(module.js, 10, 3)) ->Outer.Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ->Outer : Symbol(Outer, Decl(module.js, 0, 3), Decl(module.js, 0, 14), Decl(module.js, 1, 27)) ->Inner : Symbol(Outer.Inner, Decl(module.js, 0, 14), Decl(module.js, 2, 6)) ++>Outer.Inner : Symbol(Inner, Decl(module.js, 0, 14)) +>Outer : Symbol(Outer, Decl(module.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(module.js, 0, 14)) inner.m() ->inner.m : Symbol(m, Decl(module.js, 2, 25)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.types index 923f240dda..b33a8e7f48 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment13.types @@ -2,23 +2,23 @@ === module.js === var Outer = {} ->Outer : {} ->{} : {} +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>{} : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } Outer.Inner = function() {} ->Outer.Inner = function() {} : () => void ->Outer.Inner : any ->Outer : {} ->Inner : any ->function() {} : () => void +>Outer.Inner = function() {} : { (): void; prototype: { m(): void; i: number; }; } +>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>function() {} : { (): void; prototype: { m(): void; i: number; }; } Outer.Inner.prototype = { >Outer.Inner.prototype = { m() { }, i: 1} : { m(): void; i: number; } ->Outer.Inner.prototype : any ->Outer.Inner : any ->Outer : {} ->Inner : any ->prototype : any +>Outer.Inner.prototype : { m(): void; i: number; } +>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >{ m() { }, i: 1} : { m(): void; i: number; } m() { }, @@ -32,30 +32,30 @@ Outer.Inner.prototype = { Outer.Inner.prototype.j = 2 >Outer.Inner.prototype.j = 2 : 2 >Outer.Inner.prototype.j : any ->Outer.Inner.prototype : any ->Outer.Inner : any ->Outer : {} ->Inner : any ->prototype : any +>Outer.Inner.prototype : { m(): void; i: number; } +>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >j : any >2 : 2 /** @type {string} */ Outer.Inner.prototype.k; >Outer.Inner.prototype.k : any ->Outer.Inner.prototype : any ->Outer.Inner : any ->Outer : {} ->Inner : any ->prototype : any +>Outer.Inner.prototype : { m(): void; i: number; } +>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } +>prototype : { m(): void; i: number; } >k : any var inner = new Outer.Inner() >inner : any >new Outer.Inner() : any ->Outer.Inner : any ->Outer : {} ->Inner : any +>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } +>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } +>Inner : { (): void; prototype: { m(): void; i: number; }; } inner.m() >inner.m() : any diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.errors.txt index 80ee28806b..3b6a9cb547 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.errors.txt @@ -1,14 +1,10 @@ -a.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. a.js(10,12): error TS2503: Cannot find namespace 'Outer'. -a.js(14,22): error TS2339: Property 'Inner' does not exist on type '{}'. -==== a.js (3 errors) ==== +==== a.js (1 errors) ==== var Outer = {}; Outer.Inner = class { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. constructor() { this.x = 1 } @@ -22,8 +18,6 @@ a.js(14,22): error TS2339: Property 'Inner' does not exist on type '{}'. inner.x inner.m() var inno = new Outer.Inner() - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. inno.x inno.m() \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols index b72639295b..10406c6935 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols @@ -5,7 +5,9 @@ var Outer = {}; >Outer : Symbol(Outer, Decl(a.js, 0, 3)) Outer.Inner = class { +>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 0, 15)) constructor() { this.x = 1 @@ -29,11 +31,17 @@ inner.m() var inno = new Outer.Inner() >inno : Symbol(inno, Decl(a.js, 13, 3)) +>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 0, 15)) inno.x +>inno.x : Symbol(x, Decl(a.js, 3, 19)) >inno : Symbol(inno, Decl(a.js, 13, 3)) +>x : Symbol(x, Decl(a.js, 3, 19)) inno.m() +>inno.m : Symbol(m, Decl(a.js, 5, 5)) >inno : Symbol(inno, Decl(a.js, 13, 3)) +>m : Symbol(m, Decl(a.js, 5, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols.diff index c11060aeba..6276483398 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.symbols.diff @@ -11,7 +11,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 0, 15)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 0, 15)) constructor() { this.x = 1 @@ -27,7 +29,7 @@ } /** @type {Outer.Inner} */ -@@= skipped -22, +20 lines =@@ +@@= skipped -22, +22 lines =@@ >inner : Symbol(inner, Decl(a.js, 10, 3)) inner.x @@ -45,14 +47,20 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 0, 15)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 0, 15)) inno.x ->inno.x : Symbol(Inner.x, Decl(a.js, 3, 19)) ++>inno.x : Symbol(x, Decl(a.js, 3, 19)) >inno : Symbol(inno, Decl(a.js, 13, 3)) ->x : Symbol(Inner.x, Decl(a.js, 3, 19)) ++>x : Symbol(x, Decl(a.js, 3, 19)) inno.m() ->inno.m : Symbol(Inner.m, Decl(a.js, 5, 5)) ++>inno.m : Symbol(m, Decl(a.js, 5, 5)) >inno : Symbol(inno, Decl(a.js, 13, 3)) ->m : Symbol(Inner.m, Decl(a.js, 5, 5)) ++>m : Symbol(m, Decl(a.js, 5, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.types index 60d9e59b58..94ffe7599e 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment15.types @@ -2,14 +2,14 @@ === a.js === var Outer = {}; ->Outer : {} ->{} : {} +>Outer : { Inner: typeof Inner; } +>{} : { Inner: typeof Inner; } Outer.Inner = class { >Outer.Inner = class { constructor() { this.x = 1 } m() { }} : typeof Inner ->Outer.Inner : any ->Outer : {} ->Inner : any +>Outer.Inner : typeof Inner +>Outer : { Inner: typeof Inner; } +>Inner : typeof Inner >class { constructor() { this.x = 1 } m() { }} : typeof Inner constructor() { @@ -40,20 +40,20 @@ inner.m() >m : any var inno = new Outer.Inner() ->inno : any ->new Outer.Inner() : any ->Outer.Inner : any ->Outer : {} ->Inner : any +>inno : Inner +>new Outer.Inner() : Inner +>Outer.Inner : typeof Inner +>Outer : { Inner: typeof Inner; } +>Inner : typeof Inner inno.x ->inno.x : any ->inno : any ->x : any +>inno.x : number +>inno : Inner +>x : number inno.m() ->inno.m() : any ->inno.m : any ->inno : any ->m : any +>inno.m() : void +>inno.m : () => void +>inno : Inner +>m : () => void diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.errors.txt index c54db8a4a9..c1019b00ed 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.errors.txt @@ -1,18 +1,11 @@ -a.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. -a.js(4,7): error TS2339: Property 'Inner' does not exist on type '{}'. a.js(9,12): error TS2503: Cannot find namespace 'Outer'. -a.js(13,22): error TS2339: Property 'Inner' does not exist on type '{}'. -==== a.js (4 errors) ==== +==== a.js (1 errors) ==== var Outer = {}; Outer.Inner = function () {} - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. Outer.Inner.prototype = { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. x: 1, m() { } } @@ -24,8 +17,6 @@ a.js(13,22): error TS2339: Property 'Inner' does not exist on type '{}'. inner.x inner.m() var inno = new Outer.Inner() - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. inno.x inno.m() \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols index 78df351374..cab9c397d8 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols @@ -5,10 +5,16 @@ var Outer = {}; >Outer : Symbol(Outer, Decl(a.js, 0, 3)) Outer.Inner = function () {} +>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 0, 15)) Outer.Inner.prototype = { +>Outer.Inner.prototype : Symbol(prototype, Decl(a.js, 2, 28)) +>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>prototype : Symbol(prototype, Decl(a.js, 2, 28)) x: 1, >x : Symbol(x, Decl(a.js, 3, 25)) @@ -29,7 +35,9 @@ inner.m() var inno = new Outer.Inner() >inno : Symbol(inno, Decl(a.js, 12, 3)) +>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 0, 15)) inno.x >inno : Symbol(inno, Decl(a.js, 12, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols.diff index b6e234a02b..900317b765 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.symbols.diff @@ -11,7 +11,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15), Decl(a.js, 3, 6)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 0, 15), Decl(a.js, 2, 28)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15), Decl(a.js, 3, 6)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 0, 15)) Outer.Inner.prototype = { ->Outer.Inner.prototype : Symbol(Outer.Inner.prototype, Decl(a.js, 2, 28)) @@ -19,11 +21,15 @@ ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 0, 15), Decl(a.js, 2, 28)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15), Decl(a.js, 3, 6)) ->prototype : Symbol(Outer.Inner.prototype, Decl(a.js, 2, 28)) ++>Outer.Inner.prototype : Symbol(prototype, Decl(a.js, 2, 28)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 0, 15)) ++>prototype : Symbol(prototype, Decl(a.js, 2, 28)) x: 1, >x : Symbol(x, Decl(a.js, 3, 25)) -@@= skipped -26, +20 lines =@@ +@@= skipped -26, +26 lines =@@ >inner : Symbol(inner, Decl(a.js, 9, 3)) inner.x @@ -41,7 +47,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15), Decl(a.js, 3, 6)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 0, 15), Decl(a.js, 2, 28)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 0, 15), Decl(a.js, 3, 6)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 0, 15)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 0, 15)) inno.x ->inno.x : Symbol(x, Decl(a.js, 3, 25)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.types index d5354b026e..bbb2a3bdcf 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment16.types @@ -2,23 +2,23 @@ === a.js === var Outer = {}; ->Outer : {} ->{} : {} +>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } +>{} : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } Outer.Inner = function () {} ->Outer.Inner = function () {} : () => void ->Outer.Inner : any ->Outer : {} ->Inner : any ->function () {} : () => void +>Outer.Inner = function () {} : { (): void; prototype: { x: number; m(): void; }; } +>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } +>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } +>Inner : { (): void; prototype: { x: number; m(): void; }; } +>function () {} : { (): void; prototype: { x: number; m(): void; }; } Outer.Inner.prototype = { >Outer.Inner.prototype = { x: 1, m() { }} : { x: number; m(): void; } ->Outer.Inner.prototype : any ->Outer.Inner : any ->Outer : {} ->Inner : any ->prototype : any +>Outer.Inner.prototype : { x: number; m(): void; } +>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } +>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } +>Inner : { (): void; prototype: { x: number; m(): void; }; } +>prototype : { x: number; m(): void; } >{ x: 1, m() { }} : { x: number; m(): void; } x: 1, @@ -47,9 +47,9 @@ inner.m() var inno = new Outer.Inner() >inno : any >new Outer.Inner() : any ->Outer.Inner : any ->Outer : {} ->Inner : any +>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } +>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } +>Inner : { (): void; prototype: { x: number; m(): void; }; } inno.x >inno.x : any diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.errors.txt index 70530b8dbb..6aa3c8b8c4 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.errors.txt @@ -1,32 +1,23 @@ -a.js(4,10): error TS2339: Property 'p' does not exist on type '{}'. -a.js(5,12): error TS2339: Property 'q' does not exist on type '{}'. -a.js(7,10): error TS2339: Property 'p' does not exist on type '{}'. -a.js(8,10): error TS2339: Property 'q' does not exist on type '{}'. -a.js(9,12): error TS2339: Property 'p' does not exist on type '{}'. -a.js(10,12): error TS2339: Property 'q' does not exist on type '{}'. +a.js(4,10): error TS2339: Property 'p' does not exist on type '{ q: number; }'. +a.js(7,10): error TS2339: Property 'p' does not exist on type '{ q: number; }'. +a.js(9,12): error TS2339: Property 'p' does not exist on type '{ q: number; }'. -==== a.js (6 errors) ==== +==== a.js (3 errors) ==== var GLOBSTAR = m.GLOBSTAR = {} function m() { } GLOBSTAR.p = 1 ~ -!!! error TS2339: Property 'p' does not exist on type '{}'. +!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. m.GLOBSTAR.q = 2 - ~ -!!! error TS2339: Property 'q' does not exist on type '{}'. GLOBSTAR.p ~ -!!! error TS2339: Property 'p' does not exist on type '{}'. +!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. GLOBSTAR.q - ~ -!!! error TS2339: Property 'q' does not exist on type '{}'. m.GLOBSTAR.p ~ -!!! error TS2339: Property 'p' does not exist on type '{}'. +!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. m.GLOBSTAR.q - ~ -!!! error TS2339: Property 'q' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols index 39e17512da..1a6dddf204 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols @@ -14,15 +14,19 @@ GLOBSTAR.p = 1 >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3)) m.GLOBSTAR.q = 2 +>m.GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) >m.GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) >m : Symbol(m, Decl(a.js, 0, 30)) >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) +>q : Symbol(q, Decl(a.js, 3, 14)) GLOBSTAR.p >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3)) GLOBSTAR.q +>GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3)) +>q : Symbol(q, Decl(a.js, 3, 14)) m.GLOBSTAR.p >m.GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) @@ -30,7 +34,9 @@ m.GLOBSTAR.p >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) m.GLOBSTAR.q +>m.GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) >m.GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) >m : Symbol(m, Decl(a.js, 0, 30)) >GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) +>q : Symbol(q, Decl(a.js, 3, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols.diff index be7b8bae3f..444112936f 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.symbols.diff @@ -29,9 +29,11 @@ ->m : Symbol(m, Decl(a.js, 0, 30), Decl(a.js, 3, 14)) ->GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14), Decl(a.js, 4, 2)) ->q : Symbol(m.GLOBSTAR.q, Decl(a.js, 3, 14)) ++>m.GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) +>m.GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) +>m : Symbol(m, Decl(a.js, 0, 30)) +>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) ++>q : Symbol(q, Decl(a.js, 3, 14)) GLOBSTAR.p ->GLOBSTAR.p : Symbol(GLOBSTAR.p, Decl(a.js, 2, 1)) @@ -43,7 +45,9 @@ ->GLOBSTAR.q : Symbol(m.GLOBSTAR.q, Decl(a.js, 3, 14)) ->GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3), Decl(a.js, 2, 1)) ->q : Symbol(m.GLOBSTAR.q, Decl(a.js, 3, 14)) ++>GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) +>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 3)) ++>q : Symbol(q, Decl(a.js, 3, 14)) m.GLOBSTAR.p ->m.GLOBSTAR.p : Symbol(GLOBSTAR.p, Decl(a.js, 2, 1)) @@ -61,6 +65,8 @@ ->m : Symbol(m, Decl(a.js, 0, 30), Decl(a.js, 3, 14)) ->GLOBSTAR : Symbol(m.GLOBSTAR, Decl(a.js, 0, 14), Decl(a.js, 4, 2)) ->q : Symbol(m.GLOBSTAR.q, Decl(a.js, 3, 14)) ++>m.GLOBSTAR.q : Symbol(q, Decl(a.js, 3, 14)) +>m.GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) +>m : Symbol(m, Decl(a.js, 0, 30)) +>GLOBSTAR : Symbol(GLOBSTAR, Decl(a.js, 0, 14)) ++>q : Symbol(q, Decl(a.js, 3, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.types index 7dd6955506..9adae1c871 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment18.types @@ -2,53 +2,53 @@ === a.js === var GLOBSTAR = m.GLOBSTAR = {} ->GLOBSTAR : {} ->m.GLOBSTAR = {} : {} ->m.GLOBSTAR : {} ->m : { (): void; GLOBSTAR: {}; } ->GLOBSTAR : {} ->{} : {} +>GLOBSTAR : { q: number; } +>m.GLOBSTAR = {} : { q: number; } +>m.GLOBSTAR : { q: number; } +>m : { (): void; GLOBSTAR: { q: number; }; } +>GLOBSTAR : { q: number; } +>{} : { q: number; } function m() { ->m : { (): void; GLOBSTAR: {}; } +>m : { (): void; GLOBSTAR: { q: number; }; } } GLOBSTAR.p = 1 >GLOBSTAR.p = 1 : 1 >GLOBSTAR.p : any ->GLOBSTAR : {} +>GLOBSTAR : { q: number; } >p : any >1 : 1 m.GLOBSTAR.q = 2 >m.GLOBSTAR.q = 2 : 2 ->m.GLOBSTAR.q : any ->m.GLOBSTAR : {} ->m : { (): void; GLOBSTAR: {}; } ->GLOBSTAR : {} ->q : any +>m.GLOBSTAR.q : number +>m.GLOBSTAR : { q: number; } +>m : { (): void; GLOBSTAR: { q: number; }; } +>GLOBSTAR : { q: number; } +>q : number >2 : 2 GLOBSTAR.p >GLOBSTAR.p : any ->GLOBSTAR : {} +>GLOBSTAR : { q: number; } >p : any GLOBSTAR.q ->GLOBSTAR.q : any ->GLOBSTAR : {} ->q : any +>GLOBSTAR.q : number +>GLOBSTAR : { q: number; } +>q : number m.GLOBSTAR.p >m.GLOBSTAR.p : any ->m.GLOBSTAR : {} ->m : { (): void; GLOBSTAR: {}; } ->GLOBSTAR : {} +>m.GLOBSTAR : { q: number; } +>m : { (): void; GLOBSTAR: { q: number; }; } +>GLOBSTAR : { q: number; } >p : any m.GLOBSTAR.q ->m.GLOBSTAR.q : any ->m.GLOBSTAR : {} ->m : { (): void; GLOBSTAR: {}; } ->GLOBSTAR : {} ->q : any +>m.GLOBSTAR.q : number +>m.GLOBSTAR : { q: number; } +>m : { (): void; GLOBSTAR: { q: number; }; } +>GLOBSTAR : { q: number; } +>q : number diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.errors.txt index 4de02a5a06..34809387cc 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.errors.txt @@ -1,19 +1,15 @@ -def.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -usage.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -usage.js(5,19): error TS2339: Property 'Inner' does not exist on type '{}'. +usage.js(2,13): error TS2339: Property 'Message' does not exist on type 'typeof Inner'. usage.js(7,12): error TS2503: Cannot find namespace 'Outer'. -==== usage.js (3 errors) ==== +==== usage.js (2 errors) ==== // note that usage is first in the compilation Outer.Inner.Message = function() { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. + ~~~~~~~ +!!! error TS2339: Property 'Message' does not exist on type 'typeof Inner'. }; var y = new Outer.Inner() - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. y.name /** @type {Outer.Inner} should be instance type, not static type */ ~~~~~ @@ -21,11 +17,9 @@ usage.js(7,12): error TS2503: Cannot find namespace 'Outer'. var x; x.name -==== def.js (1 errors) ==== +==== def.js (0 errors) ==== var Outer = {} Outer.Inner = class { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '{}'. name() { return 'hi' } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols index 8329cdcf42..46df3ea278 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols @@ -3,16 +3,22 @@ === usage.js === // note that usage is first in the compilation Outer.Inner.Message = function() { +>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) >Outer : Symbol(Outer, Decl(def.js, 0, 3)) +>Inner : Symbol(Inner, Decl(def.js, 0, 14)) }; var y = new Outer.Inner() >y : Symbol(y, Decl(usage.js, 4, 3)) +>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) >Outer : Symbol(Outer, Decl(def.js, 0, 3)) +>Inner : Symbol(Inner, Decl(def.js, 0, 14)) y.name +>y.name : Symbol(name, Decl(def.js, 1, 21)) >y : Symbol(y, Decl(usage.js, 4, 3)) +>name : Symbol(name, Decl(def.js, 1, 21)) /** @type {Outer.Inner} should be instance type, not static type */ var x; @@ -26,7 +32,9 @@ var Outer = {} >Outer : Symbol(Outer, Decl(def.js, 0, 3)) Outer.Inner = class { +>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) >Outer : Symbol(Outer, Decl(def.js, 0, 3)) +>Inner : Symbol(Inner, Decl(def.js, 0, 14)) name() { >name : Symbol(name, Decl(def.js, 1, 21)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols.diff index b235840ff7..30f1e46620 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.symbols.diff @@ -9,7 +9,9 @@ ->Outer : Symbol(Outer, Decl(usage.js, 0, 0), Decl(def.js, 0, 3), Decl(def.js, 0, 14)) ->Inner : Symbol(Outer.Inner, Decl(usage.js, 1, 6), Decl(def.js, 0, 14)) ->Message : Symbol(Outer.Inner.Message, Decl(usage.js, 0, 0)) ++>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) +>Outer : Symbol(Outer, Decl(def.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(def.js, 0, 14)) }; @@ -18,12 +20,16 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(usage.js, 1, 6), Decl(def.js, 0, 14)) ->Outer : Symbol(Outer, Decl(usage.js, 0, 0), Decl(def.js, 0, 3), Decl(def.js, 0, 14)) ->Inner : Symbol(Outer.Inner, Decl(usage.js, 1, 6), Decl(def.js, 0, 14)) ++>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) +>Outer : Symbol(Outer, Decl(def.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(def.js, 0, 14)) y.name ->y.name : Symbol(Inner.name, Decl(def.js, 1, 21)) ++>y.name : Symbol(name, Decl(def.js, 1, 21)) >y : Symbol(y, Decl(usage.js, 4, 3)) ->name : Symbol(Inner.name, Decl(def.js, 1, 21)) ++>name : Symbol(name, Decl(def.js, 1, 21)) /** @type {Outer.Inner} should be instance type, not static type */ var x; @@ -43,7 +49,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(usage.js, 1, 6), Decl(def.js, 0, 14)) ->Outer : Symbol(Outer, Decl(usage.js, 0, 0), Decl(def.js, 0, 3), Decl(def.js, 0, 14)) ->Inner : Symbol(Outer.Inner, Decl(usage.js, 1, 6), Decl(def.js, 0, 14)) ++>Outer.Inner : Symbol(Inner, Decl(def.js, 0, 14)) +>Outer : Symbol(Outer, Decl(def.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(def.js, 0, 14)) name() { ->name : Symbol(Inner.name, Decl(def.js, 1, 21)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.types index 74b5311c96..5e3dfa4606 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment24.types @@ -5,25 +5,25 @@ Outer.Inner.Message = function() { >Outer.Inner.Message = function() {} : () => void >Outer.Inner.Message : any ->Outer.Inner : any ->Outer : {} ->Inner : any +>Outer.Inner : typeof Inner +>Outer : { Inner: typeof Inner; } +>Inner : typeof Inner >Message : any >function() {} : () => void }; var y = new Outer.Inner() ->y : any ->new Outer.Inner() : any ->Outer.Inner : any ->Outer : {} ->Inner : any +>y : Inner +>new Outer.Inner() : Inner +>Outer.Inner : typeof Inner +>Outer : { Inner: typeof Inner; } +>Inner : typeof Inner y.name ->y.name : any ->y : any ->name : any +>y.name : () => string +>y : Inner +>name : () => string /** @type {Outer.Inner} should be instance type, not static type */ var x; @@ -36,14 +36,14 @@ x.name === def.js === var Outer = {} ->Outer : {} ->{} : {} +>Outer : { Inner: typeof Inner; } +>{} : { Inner: typeof Inner; } Outer.Inner = class { >Outer.Inner = class { name() { return 'hi' }} : typeof Inner ->Outer.Inner : any ->Outer : {} ->Inner : any +>Outer.Inner : typeof Inner +>Outer : { Inner: typeof Inner; } +>Inner : typeof Inner >class { name() { return 'hi' }} : typeof Inner name() { diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.errors.txt deleted file mode 100644 index 9e77b28dc2..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -bug24703.js(2,8): error TS2339: Property 'I' does not exist on type '{}'. -bug24703.js(7,8): error TS2339: Property 'O' does not exist on type '{}'. -bug24703.js(7,33): error TS2339: Property 'I' does not exist on type '{}'. -bug24703.js(13,20): error TS2339: Property 'O' does not exist on type '{}'. -bug24703.js(14,20): error TS2339: Property 'I' does not exist on type '{}'. - - -==== bug24703.js (5 errors) ==== - var Common = {}; - Common.I = class { - ~ -!!! error TS2339: Property 'I' does not exist on type '{}'. - constructor() { - this.i = 1 - } - } - Common.O = class extends Common.I { - ~ -!!! error TS2339: Property 'O' does not exist on type '{}'. - ~ -!!! error TS2339: Property 'I' does not exist on type '{}'. - constructor() { - super() - this.o = 2 - } - } - var o = new Common.O() - ~ -!!! error TS2339: Property 'O' does not exist on type '{}'. - var i = new Common.I() - ~ -!!! error TS2339: Property 'I' does not exist on type '{}'. - o.i - o.o - i.i - - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols index 43bb363825..23930919b0 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols @@ -5,7 +5,9 @@ var Common = {}; >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) Common.I = class { +>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) +>I : Symbol(I, Decl(bug24703.js, 0, 16)) constructor() { this.i = 1 @@ -15,11 +17,17 @@ Common.I = class { } } Common.O = class extends Common.I { +>Common.O : Symbol(O, Decl(bug24703.js, 5, 1)) >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) +>O : Symbol(O, Decl(bug24703.js, 5, 1)) +>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) +>I : Symbol(I, Decl(bug24703.js, 0, 16)) constructor() { super() +>super : Symbol(I, Decl(bug24703.js, 1, 10)) + this.o = 2 >this.o : Symbol(o, Decl(bug24703.js, 8, 15)) >this : Symbol(O, Decl(bug24703.js, 6, 10)) @@ -28,19 +36,29 @@ Common.O = class extends Common.I { } var o = new Common.O() >o : Symbol(o, Decl(bug24703.js, 12, 3)) +>Common.O : Symbol(O, Decl(bug24703.js, 5, 1)) >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) +>O : Symbol(O, Decl(bug24703.js, 5, 1)) var i = new Common.I() >i : Symbol(i, Decl(bug24703.js, 13, 3)) +>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) >Common : Symbol(Common, Decl(bug24703.js, 0, 3)) +>I : Symbol(I, Decl(bug24703.js, 0, 16)) o.i +>o.i : Symbol(i, Decl(bug24703.js, 2, 19)) >o : Symbol(o, Decl(bug24703.js, 12, 3)) +>i : Symbol(i, Decl(bug24703.js, 2, 19)) o.o +>o.o : Symbol(o, Decl(bug24703.js, 8, 15)) >o : Symbol(o, Decl(bug24703.js, 12, 3)) +>o : Symbol(o, Decl(bug24703.js, 8, 15)) i.i +>i.i : Symbol(i, Decl(bug24703.js, 2, 19)) >i : Symbol(i, Decl(bug24703.js, 13, 3)) +>i : Symbol(i, Decl(bug24703.js, 2, 19)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols.diff index 71dc4e7320..236b424fa3 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.symbols.diff @@ -11,7 +11,9 @@ ->Common.I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ->Common : Symbol(Common, Decl(bug24703.js, 0, 3), Decl(bug24703.js, 0, 16), Decl(bug24703.js, 5, 1)) ->I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ++>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) +>Common : Symbol(Common, Decl(bug24703.js, 0, 3)) ++>I : Symbol(I, Decl(bug24703.js, 0, 16)) constructor() { this.i = 1 @@ -29,13 +31,17 @@ ->Common.I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ->Common : Symbol(Common, Decl(bug24703.js, 0, 3), Decl(bug24703.js, 0, 16), Decl(bug24703.js, 5, 1)) ->I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ++>Common.O : Symbol(O, Decl(bug24703.js, 5, 1)) +>Common : Symbol(Common, Decl(bug24703.js, 0, 3)) ++>O : Symbol(O, Decl(bug24703.js, 5, 1)) ++>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) +>Common : Symbol(Common, Decl(bug24703.js, 0, 3)) ++>I : Symbol(I, Decl(bug24703.js, 0, 16)) constructor() { super() -->super : Symbol(I, Decl(bug24703.js, 1, 10)) -- + >super : Symbol(I, Decl(bug24703.js, 1, 10)) + this.o = 2 ->this.o : Symbol(O.o, Decl(bug24703.js, 8, 15)) +>this.o : Symbol(o, Decl(bug24703.js, 8, 15)) @@ -49,27 +55,37 @@ ->Common.O : Symbol(Common.O, Decl(bug24703.js, 5, 1)) ->Common : Symbol(Common, Decl(bug24703.js, 0, 3), Decl(bug24703.js, 0, 16), Decl(bug24703.js, 5, 1)) ->O : Symbol(Common.O, Decl(bug24703.js, 5, 1)) ++>Common.O : Symbol(O, Decl(bug24703.js, 5, 1)) +>Common : Symbol(Common, Decl(bug24703.js, 0, 3)) ++>O : Symbol(O, Decl(bug24703.js, 5, 1)) var i = new Common.I() >i : Symbol(i, Decl(bug24703.js, 13, 3)) ->Common.I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ->Common : Symbol(Common, Decl(bug24703.js, 0, 3), Decl(bug24703.js, 0, 16), Decl(bug24703.js, 5, 1)) ->I : Symbol(Common.I, Decl(bug24703.js, 0, 16)) ++>Common.I : Symbol(I, Decl(bug24703.js, 0, 16)) +>Common : Symbol(Common, Decl(bug24703.js, 0, 3)) ++>I : Symbol(I, Decl(bug24703.js, 0, 16)) o.i ->o.i : Symbol(I.i, Decl(bug24703.js, 2, 19)) ++>o.i : Symbol(i, Decl(bug24703.js, 2, 19)) >o : Symbol(o, Decl(bug24703.js, 12, 3)) ->i : Symbol(I.i, Decl(bug24703.js, 2, 19)) ++>i : Symbol(i, Decl(bug24703.js, 2, 19)) o.o ->o.o : Symbol(O.o, Decl(bug24703.js, 8, 15)) ++>o.o : Symbol(o, Decl(bug24703.js, 8, 15)) >o : Symbol(o, Decl(bug24703.js, 12, 3)) ->o : Symbol(O.o, Decl(bug24703.js, 8, 15)) ++>o : Symbol(o, Decl(bug24703.js, 8, 15)) i.i ->i.i : Symbol(I.i, Decl(bug24703.js, 2, 19)) ++>i.i : Symbol(i, Decl(bug24703.js, 2, 19)) >i : Symbol(i, Decl(bug24703.js, 13, 3)) ->i : Symbol(I.i, Decl(bug24703.js, 2, 19)) ++>i : Symbol(i, Decl(bug24703.js, 2, 19)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.types index d5060eb909..88af1cf8ca 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment25.types @@ -2,14 +2,14 @@ === bug24703.js === var Common = {}; ->Common : {} ->{} : {} +>Common : { I: typeof I; O: typeof O; } +>{} : { I: typeof I; O: typeof O; } Common.I = class { >Common.I = class { constructor() { this.i = 1 }} : typeof I ->Common.I : any ->Common : {} ->I : any +>Common.I : typeof I +>Common : { I: typeof I; O: typeof O; } +>I : typeof I >class { constructor() { this.i = 1 }} : typeof I constructor() { @@ -23,18 +23,18 @@ Common.I = class { } Common.O = class extends Common.I { >Common.O = class extends Common.I { constructor() { super() this.o = 2 }} : typeof O ->Common.O : any ->Common : {} ->O : any +>Common.O : typeof O +>Common : { I: typeof I; O: typeof O; } +>O : typeof O >class extends Common.I { constructor() { super() this.o = 2 }} : typeof O ->Common.I : any ->Common : {} ->I : any +>Common.I : I +>Common : { I: typeof I; O: typeof O; } +>I : typeof I constructor() { super() >super() : void ->super : any +>super : typeof I this.o = 2 >this.o = 2 : 2 @@ -45,32 +45,32 @@ Common.O = class extends Common.I { } } var o = new Common.O() ->o : any ->new Common.O() : any ->Common.O : any ->Common : {} ->O : any +>o : O +>new Common.O() : O +>Common.O : typeof O +>Common : { I: typeof I; O: typeof O; } +>O : typeof O var i = new Common.I() ->i : any ->new Common.I() : any ->Common.I : any ->Common : {} ->I : any +>i : I +>new Common.I() : I +>Common.I : typeof I +>Common : { I: typeof I; O: typeof O; } +>I : typeof I o.i ->o.i : any ->o : any ->i : any +>o.i : number +>o : O +>i : number o.o ->o.o : any ->o : any ->o : any +>o.o : number +>o : O +>o : number i.i ->i.i : any ->i : any ->i : any +>i.i : number +>i : I +>i : number diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.errors.txt index 0364a0e7ca..ff87b70039 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.errors.txt @@ -1,36 +1,24 @@ -bug24730.js(2,4): error TS2339: Property 'TreeElement' does not exist on type '{}'. -bug24730.js(7,4): error TS2339: Property 'context' does not exist on type '{}'. -bug24730.js(7,21): error TS2339: Property 'TreeElement' does not exist on type '{}'. -bug24730.js(9,20): error TS2339: Property 'TreeElement' does not exist on type '{}'. bug24730.js(11,14): error TS2339: Property 'doesNotExist' does not exist on type 'C'. -bug24730.js(12,14): error TS2339: Property 'treeOutline' does not exist on type 'C'. +bug24730.js(12,26): error TS2339: Property 'doesntExistEither' does not exist on type 'number'. -==== bug24730.js (6 errors) ==== +==== bug24730.js (2 errors) ==== var UI = {} UI.TreeElement = class { - ~~~~~~~~~~~ -!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. constructor() { this.treeOutline = 12 } }; UI.context = new UI.TreeElement() - ~~~~~~~ -!!! error TS2339: Property 'context' does not exist on type '{}'. - ~~~~~~~~~~~ -!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. class C extends UI.TreeElement { - ~~~~~~~~~~~ -!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. onpopulate() { this.doesNotExist ~~~~~~~~~~~~ !!! error TS2339: Property 'doesNotExist' does not exist on type 'C'. this.treeOutline.doesntExistEither() - ~~~~~~~~~~~ -!!! error TS2339: Property 'treeOutline' does not exist on type 'C'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'doesntExistEither' does not exist on type 'number'. } }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols index cf4fb9c73c..51ced792a7 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols @@ -5,7 +5,9 @@ var UI = {} >UI : Symbol(UI, Decl(bug24730.js, 0, 3)) UI.TreeElement = class { +>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) >UI : Symbol(UI, Decl(bug24730.js, 0, 3)) +>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) constructor() { this.treeOutline = 12 @@ -15,12 +17,18 @@ UI.TreeElement = class { } }; UI.context = new UI.TreeElement() +>UI.context : Symbol(context, Decl(bug24730.js, 5, 2)) >UI : Symbol(UI, Decl(bug24730.js, 0, 3)) +>context : Symbol(context, Decl(bug24730.js, 5, 2)) +>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) >UI : Symbol(UI, Decl(bug24730.js, 0, 3)) +>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) class C extends UI.TreeElement { >C : Symbol(C, Decl(bug24730.js, 6, 33)) +>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) >UI : Symbol(UI, Decl(bug24730.js, 0, 3)) +>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) onpopulate() { >onpopulate : Symbol(onpopulate, Decl(bug24730.js, 8, 32)) @@ -29,7 +37,9 @@ class C extends UI.TreeElement { >this : Symbol(C, Decl(bug24730.js, 6, 33)) this.treeOutline.doesntExistEither() +>this.treeOutline : Symbol(treeOutline, Decl(bug24730.js, 2, 19)) >this : Symbol(C, Decl(bug24730.js, 6, 33)) +>treeOutline : Symbol(treeOutline, Decl(bug24730.js, 2, 19)) } }; diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols.diff index 2d1ca9c493..3ea5f3ccb6 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.symbols.diff @@ -11,7 +11,9 @@ ->UI.TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ->UI : Symbol(UI, Decl(bug24730.js, 0, 3), Decl(bug24730.js, 0, 11), Decl(bug24730.js, 5, 2)) ->TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ++>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) +>UI : Symbol(UI, Decl(bug24730.js, 0, 3)) ++>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) constructor() { this.treeOutline = 12 @@ -29,15 +31,21 @@ ->UI.TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ->UI : Symbol(UI, Decl(bug24730.js, 0, 3), Decl(bug24730.js, 0, 11), Decl(bug24730.js, 5, 2)) ->TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ++>UI.context : Symbol(context, Decl(bug24730.js, 5, 2)) +>UI : Symbol(UI, Decl(bug24730.js, 0, 3)) ++>context : Symbol(context, Decl(bug24730.js, 5, 2)) ++>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) +>UI : Symbol(UI, Decl(bug24730.js, 0, 3)) ++>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) class C extends UI.TreeElement { >C : Symbol(C, Decl(bug24730.js, 6, 33)) ->UI.TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ->UI : Symbol(UI, Decl(bug24730.js, 0, 3), Decl(bug24730.js, 0, 11), Decl(bug24730.js, 5, 2)) ->TreeElement : Symbol(UI.TreeElement, Decl(bug24730.js, 0, 11)) ++>UI.TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) +>UI : Symbol(UI, Decl(bug24730.js, 0, 3)) ++>TreeElement : Symbol(TreeElement, Decl(bug24730.js, 0, 11)) onpopulate() { ->onpopulate : Symbol(C.onpopulate, Decl(bug24730.js, 8, 32)) @@ -48,7 +56,9 @@ this.treeOutline.doesntExistEither() ->this.treeOutline : Symbol(TreeElement.treeOutline, Decl(bug24730.js, 2, 19)) ++>this.treeOutline : Symbol(treeOutline, Decl(bug24730.js, 2, 19)) >this : Symbol(C, Decl(bug24730.js, 6, 33)) ->treeOutline : Symbol(TreeElement.treeOutline, Decl(bug24730.js, 2, 19)) ++>treeOutline : Symbol(treeOutline, Decl(bug24730.js, 2, 19)) } }; diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.types index e8f5b7d6b0..81ace52365 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment26.types @@ -2,14 +2,14 @@ === bug24730.js === var UI = {} ->UI : {} ->{} : {} +>UI : { TreeElement: typeof TreeElement; context: TreeElement; } +>{} : { TreeElement: typeof TreeElement; context: TreeElement; } UI.TreeElement = class { >UI.TreeElement = class { constructor() { this.treeOutline = 12 }} : typeof TreeElement ->UI.TreeElement : any ->UI : {} ->TreeElement : any +>UI.TreeElement : typeof TreeElement +>UI : { TreeElement: typeof TreeElement; context: TreeElement; } +>TreeElement : typeof TreeElement >class { constructor() { this.treeOutline = 12 }} : typeof TreeElement constructor() { @@ -22,20 +22,20 @@ UI.TreeElement = class { } }; UI.context = new UI.TreeElement() ->UI.context = new UI.TreeElement() : any ->UI.context : any ->UI : {} ->context : any ->new UI.TreeElement() : any ->UI.TreeElement : any ->UI : {} ->TreeElement : any +>UI.context = new UI.TreeElement() : TreeElement +>UI.context : TreeElement +>UI : { TreeElement: typeof TreeElement; context: TreeElement; } +>context : TreeElement +>new UI.TreeElement() : TreeElement +>UI.TreeElement : typeof TreeElement +>UI : { TreeElement: typeof TreeElement; context: TreeElement; } +>TreeElement : typeof TreeElement class C extends UI.TreeElement { >C : C ->UI.TreeElement : any ->UI : {} ->TreeElement : any +>UI.TreeElement : TreeElement +>UI : { TreeElement: typeof TreeElement; context: TreeElement; } +>TreeElement : typeof TreeElement onpopulate() { >onpopulate : () => void @@ -48,9 +48,9 @@ class C extends UI.TreeElement { this.treeOutline.doesntExistEither() >this.treeOutline.doesntExistEither() : any >this.treeOutline.doesntExistEither : any ->this.treeOutline : any +>this.treeOutline : number >this : this ->treeOutline : any +>treeOutline : number >doesntExistEither : any } }; diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols index 63ba4b054b..66ab0e82d1 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols @@ -13,9 +13,9 @@ class C { constructor() { this.p = 1; } } // and that only works on classes with no superclass. // (Object.defineProperty isn't recognised as a JS special assignment right now.) C.prototype = { q: 2 }; ->C.prototype : Symbol(prototype) +>C.prototype : Symbol(prototype, Decl(a.js, 1, 41)) >C : Symbol(C, Decl(a.js, 0, 0)) ->prototype : Symbol(prototype) +>prototype : Symbol(prototype, Decl(a.js, 1, 41)) >q : Symbol(q, Decl(a.js, 6, 15)) const c = new C() diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols.diff index 4bb25ca4a2..43077b038e 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment28.symbols.diff @@ -21,9 +21,9 @@ ->C.prototype : Symbol(C.prototype, Decl(a.js, 1, 41)) ->C : Symbol(C, Decl(a.js, 0, 0), Decl(a.js, 1, 41)) ->prototype : Symbol(C.prototype, Decl(a.js, 1, 41)) -+>C.prototype : Symbol(prototype) ++>C.prototype : Symbol(prototype, Decl(a.js, 1, 41)) +>C : Symbol(C, Decl(a.js, 0, 0)) -+>prototype : Symbol(prototype) ++>prototype : Symbol(prototype, Decl(a.js, 1, 41)) >q : Symbol(q, Decl(a.js, 6, 15)) const c = new C() diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.errors.txt index c20cd846a1..da2e5fcef7 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.errors.txt @@ -1,15 +1,12 @@ -a.js(4,7): error TS2339: Property 'Inner' does not exist on type '() => void'. a.js(9,12): error TS2749: 'Outer' refers to a value, but is being used as a type here. Did you mean 'typeof Outer'? a.js(12,12): error TS2503: Cannot find namespace 'Outer'. -==== a.js (3 errors) ==== +==== a.js (2 errors) ==== var Outer = function O() { this.y = 2 } Outer.Inner = class I { - ~~~~~ -!!! error TS2339: Property 'Inner' does not exist on type '() => void'. constructor() { this.x = 1 } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols index d1ec3c0cea..b3ca1227ba 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols @@ -8,7 +8,9 @@ var Outer = function O() { this.y = 2 } Outer.Inner = class I { +>Outer.Inner : Symbol(Inner, Decl(a.js, 2, 1)) >Outer : Symbol(Outer, Decl(a.js, 0, 3)) +>Inner : Symbol(Inner, Decl(a.js, 2, 1)) >I : Symbol(I, Decl(a.js, 3, 13)) constructor() { diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols.diff index 01db2eeaa8..69a7b8ea93 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.symbols.diff @@ -17,7 +17,9 @@ ->Outer.Inner : Symbol(Outer.Inner, Decl(a.js, 2, 1)) ->Outer : Symbol(Outer, Decl(a.js, 0, 3), Decl(a.js, 2, 1)) ->Inner : Symbol(Outer.Inner, Decl(a.js, 2, 1)) ++>Outer.Inner : Symbol(Inner, Decl(a.js, 2, 1)) +>Outer : Symbol(Outer, Decl(a.js, 0, 3)) ++>Inner : Symbol(Inner, Decl(a.js, 2, 1)) >I : Symbol(I, Decl(a.js, 3, 13)) constructor() { @@ -30,7 +32,7 @@ } } /** @type {Outer} */ -@@= skipped -26, +21 lines =@@ +@@= skipped -26, +23 lines =@@ >ja : Symbol(ja, Decl(a.js, 9, 3)) ja.y diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.types index 542619d457..cffd1055d7 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment3.types @@ -2,9 +2,9 @@ === a.js === var Outer = function O() { ->Outer : () => void ->function O() { this.y = 2} : () => void ->O : () => void +>Outer : { (): void; Inner: typeof I; } +>function O() { this.y = 2} : { (): void; Inner: typeof I; } +>O : { (): void; Inner: typeof I; } this.y = 2 >this.y = 2 : 2 @@ -15,9 +15,9 @@ var Outer = function O() { } Outer.Inner = class I { >Outer.Inner = class I { constructor() { this.x = 1 }} : typeof I ->Outer.Inner : any ->Outer : () => void ->Inner : any +>Outer.Inner : typeof I +>Outer : { (): void; Inner: typeof I; } +>Inner : typeof I >class I { constructor() { this.x = 1 }} : typeof I >I : typeof I diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.errors.txt index d3c5957766..28af6754c5 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.errors.txt @@ -1,19 +1,16 @@ -file1.js(2,3): error TS2339: Property 'commands' does not exist on type '{}'. -file2.js(1,3): error TS2339: Property 'commands' does not exist on type '{}'. -file2.js(2,3): error TS2339: Property 'commands' does not exist on type '{}'. +file2.js(1,12): error TS2339: Property 'a' does not exist on type '{}'. +file2.js(2,12): error TS2339: Property 'b' does not exist on type '{}'. -==== file1.js (1 errors) ==== +==== file1.js (0 errors) ==== var N = {}; N.commands = {}; - ~~~~~~~~ -!!! error TS2339: Property 'commands' does not exist on type '{}'. ==== file2.js (2 errors) ==== N.commands.a = 111; - ~~~~~~~~ -!!! error TS2339: Property 'commands' does not exist on type '{}'. + ~ +!!! error TS2339: Property 'a' does not exist on type '{}'. N.commands.b = function () { }; - ~~~~~~~~ -!!! error TS2339: Property 'commands' does not exist on type '{}'. + ~ +!!! error TS2339: Property 'b' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols index c0412ae199..0aad43ebd7 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols @@ -5,12 +5,18 @@ var N = {}; >N : Symbol(N, Decl(file1.js, 0, 3)) N.commands = {}; +>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) >N : Symbol(N, Decl(file1.js, 0, 3)) +>commands : Symbol(commands, Decl(file1.js, 0, 11)) === file2.js === N.commands.a = 111; +>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) >N : Symbol(N, Decl(file1.js, 0, 3)) +>commands : Symbol(commands, Decl(file1.js, 0, 11)) N.commands.b = function () { }; +>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) >N : Symbol(N, Decl(file1.js, 0, 3)) +>commands : Symbol(commands, Decl(file1.js, 0, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols.diff index bc617bd257..cf1576bb37 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.symbols.diff @@ -11,7 +11,9 @@ ->N.commands : Symbol(N.commands, Decl(file1.js, 0, 11), Decl(file2.js, 0, 2), Decl(file2.js, 1, 2)) ->N : Symbol(N, Decl(file1.js, 0, 3), Decl(file1.js, 0, 11), Decl(file2.js, 0, 0), Decl(file2.js, 0, 19)) ->commands : Symbol(N.commands, Decl(file1.js, 0, 11), Decl(file2.js, 0, 2), Decl(file2.js, 1, 2)) ++>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) +>N : Symbol(N, Decl(file1.js, 0, 3)) ++>commands : Symbol(commands, Decl(file1.js, 0, 11)) === file2.js === N.commands.a = 111; @@ -20,7 +22,9 @@ ->N : Symbol(N, Decl(file1.js, 0, 3), Decl(file1.js, 0, 11), Decl(file2.js, 0, 0), Decl(file2.js, 0, 19)) ->commands : Symbol(N.commands, Decl(file1.js, 0, 11), Decl(file2.js, 0, 2), Decl(file2.js, 1, 2)) ->a : Symbol(N.commands.a, Decl(file2.js, 0, 0)) ++>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) +>N : Symbol(N, Decl(file1.js, 0, 3)) ++>commands : Symbol(commands, Decl(file1.js, 0, 11)) N.commands.b = function () { }; ->N.commands.b : Symbol(N.commands.b, Decl(file2.js, 0, 19)) @@ -28,4 +32,6 @@ ->N : Symbol(N, Decl(file1.js, 0, 3), Decl(file1.js, 0, 11), Decl(file2.js, 0, 0), Decl(file2.js, 0, 19)) ->commands : Symbol(N.commands, Decl(file1.js, 0, 11), Decl(file2.js, 0, 2), Decl(file2.js, 1, 2)) ->b : Symbol(N.commands.b, Decl(file2.js, 0, 19)) ++>N.commands : Symbol(commands, Decl(file1.js, 0, 11)) +>N : Symbol(N, Decl(file1.js, 0, 3)) ++>commands : Symbol(commands, Decl(file1.js, 0, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.types index 1535052ec4..30009dd281 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment34.types @@ -2,32 +2,32 @@ === file1.js === var N = {}; ->N : {} ->{} : {} +>N : { commands: {}; } +>{} : { commands: {}; } N.commands = {}; >N.commands = {} : {} ->N.commands : any ->N : {} ->commands : any +>N.commands : {} +>N : { commands: {}; } +>commands : {} >{} : {} === file2.js === N.commands.a = 111; >N.commands.a = 111 : 111 >N.commands.a : any ->N.commands : any ->N : {} ->commands : any +>N.commands : {} +>N : { commands: {}; } +>commands : {} >a : any >111 : 111 N.commands.b = function () { }; >N.commands.b = function () { } : () => void >N.commands.b : any ->N.commands : any ->N : {} ->commands : any +>N.commands : {} +>N : { commands: {}; } +>commands : {} >b : any >function () { } : () => void diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.errors.txt deleted file mode 100644 index be697e3078..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -a.js(2,1): error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. - Property 'baz' does not exist on type '{}'. -a.js(3,1): error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. - Property 'baz' does not exist on type '{}'. - - -==== a.js (2 errors) ==== - const foo = {}; - foo["baz"] = {}; - ~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -!!! error TS7053: Property 'baz' does not exist on type '{}'. - foo["baz"]["blah"] = 3; - ~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -!!! error TS7053: Property 'baz' does not exist on type '{}'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols index 57cd5f5a4a..f2aa4ec66e 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols @@ -6,7 +6,10 @@ const foo = {}; foo["baz"] = {}; >foo : Symbol(foo, Decl(a.js, 0, 5)) +>"baz" : Symbol("baz", Decl(a.js, 0, 15)) foo["baz"]["blah"] = 3; >foo : Symbol(foo, Decl(a.js, 0, 5)) +>"baz" : Symbol("baz", Decl(a.js, 0, 15)) +>"blah" : Symbol("blah", Decl(a.js, 1, 16)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols.diff index 971c141c03..994c4535b2 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.symbols.diff @@ -11,9 +11,12 @@ ->foo : Symbol(foo, Decl(a.js, 0, 5), Decl(a.js, 0, 15), Decl(a.js, 1, 16)) ->"baz" : Symbol(foo["baz"], Decl(a.js, 0, 15), Decl(a.js, 2, 4)) +>foo : Symbol(foo, Decl(a.js, 0, 5)) ++>"baz" : Symbol("baz", Decl(a.js, 0, 15)) foo["baz"]["blah"] = 3; ->foo : Symbol(foo, Decl(a.js, 0, 5), Decl(a.js, 0, 15), Decl(a.js, 1, 16)) ->"baz" : Symbol(foo["baz"], Decl(a.js, 0, 15), Decl(a.js, 2, 4)) ->"blah" : Symbol(foo["baz"]["blah"], Decl(a.js, 1, 16)) +>foo : Symbol(foo, Decl(a.js, 0, 5)) ++>"baz" : Symbol("baz", Decl(a.js, 0, 15)) ++>"blah" : Symbol("blah", Decl(a.js, 1, 16)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.types index 1fcd38c398..f59c95ffcc 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment39.types @@ -2,21 +2,21 @@ === a.js === const foo = {}; ->foo : {} ->{} : {} +>foo : { baz: { blah: number; }; } +>{} : { baz: { blah: number; }; } foo["baz"] = {}; ->foo["baz"] = {} : {} ->foo["baz"] : any ->foo : {} +>foo["baz"] = {} : { blah: number; } +>foo["baz"] : { blah: number; } +>foo : { baz: { blah: number; }; } >"baz" : "baz" ->{} : {} +>{} : { blah: number; } foo["baz"]["blah"] = 3; >foo["baz"]["blah"] = 3 : 3 ->foo["baz"]["blah"] : any ->foo["baz"] : any ->foo : {} +>foo["baz"]["blah"] : number +>foo["baz"] : { blah: number; } +>foo : { baz: { blah: number; }; } >"baz" : "baz" >"blah" : "blah" >3 : 3 diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.errors.txt index dd8addac80..f9855e7386 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.errors.txt @@ -1,15 +1,13 @@ -a.js(2,5): error TS2339: Property 'method' does not exist on type '{}'. -a.js(5,13): error TS2339: Property 'method' does not exist on type '{}'. +a.js(5,13): error TS2554: Expected 1 arguments, but got 0. -==== a.js (2 errors) ==== +==== a.js (1 errors) ==== var obj = {}; obj.method = function (hunch) { - ~~~~~~ -!!! error TS2339: Property 'method' does not exist on type '{}'. return true; } var b = obj.method(); ~~~~~~ -!!! error TS2339: Property 'method' does not exist on type '{}'. +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 a.js:2:24: An argument for 'hunch' was not provided. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols index af7f912711..f41284f8bb 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols @@ -5,12 +5,16 @@ var obj = {}; >obj : Symbol(obj, Decl(a.js, 0, 3)) obj.method = function (hunch) { +>obj.method : Symbol(method, Decl(a.js, 0, 13)) >obj : Symbol(obj, Decl(a.js, 0, 3)) +>method : Symbol(method, Decl(a.js, 0, 13)) >hunch : Symbol(hunch, Decl(a.js, 1, 23)) return true; } var b = obj.method(); >b : Symbol(b, Decl(a.js, 4, 3)) +>obj.method : Symbol(method, Decl(a.js, 0, 13)) >obj : Symbol(obj, Decl(a.js, 0, 3)) +>method : Symbol(method, Decl(a.js, 0, 13)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols.diff index 9223735ff0..81dafb1d5b 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.symbols.diff @@ -11,7 +11,9 @@ ->obj.method : Symbol(obj.method, Decl(a.js, 0, 13)) ->obj : Symbol(obj, Decl(a.js, 0, 3), Decl(a.js, 0, 13)) ->method : Symbol(obj.method, Decl(a.js, 0, 13)) ++>obj.method : Symbol(method, Decl(a.js, 0, 13)) +>obj : Symbol(obj, Decl(a.js, 0, 3)) ++>method : Symbol(method, Decl(a.js, 0, 13)) >hunch : Symbol(hunch, Decl(a.js, 1, 23)) return true; @@ -21,4 +23,6 @@ ->obj.method : Symbol(obj.method, Decl(a.js, 0, 13)) ->obj : Symbol(obj, Decl(a.js, 0, 3), Decl(a.js, 0, 13)) ->method : Symbol(obj.method, Decl(a.js, 0, 13)) ++>obj.method : Symbol(method, Decl(a.js, 0, 13)) +>obj : Symbol(obj, Decl(a.js, 0, 3)) ++>method : Symbol(method, Decl(a.js, 0, 13)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.types index b829809814..bdbb4f2b64 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment7.types @@ -2,14 +2,14 @@ === a.js === var obj = {}; ->obj : {} ->{} : {} +>obj : { method: (hunch: any) => boolean; } +>{} : { method: (hunch: any) => boolean; } obj.method = function (hunch) { >obj.method = function (hunch) { return true;} : (hunch: any) => boolean ->obj.method : any ->obj : {} ->method : any +>obj.method : (hunch: any) => boolean +>obj : { method: (hunch: any) => boolean; } +>method : (hunch: any) => boolean >function (hunch) { return true;} : (hunch: any) => boolean >hunch : any @@ -17,9 +17,9 @@ obj.method = function (hunch) { >true : true } var b = obj.method(); ->b : any ->obj.method() : any ->obj.method : any ->obj : {} ->method : any +>b : boolean +>obj.method() : boolean +>obj.method : (hunch: any) => boolean +>obj : { method: (hunch: any) => boolean; } +>method : (hunch: any) => boolean diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.errors.txt deleted file mode 100644 index 5ef280d0b6..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -a.js(5,9): error TS2339: Property 'prop' does not exist on type '{}'. -a.js(8,9): error TS2339: Property 'asyncMethod' does not exist on type '{}'. - - -==== a.js (2 errors) ==== - // this is a javascript file... - - export const Adapter = {}; - - Adapter.prop = {}; - ~~~~ -!!! error TS2339: Property 'prop' does not exist on type '{}'. - - // comment this out, and it works - Adapter.asyncMethod = function() {} - ~~~~~~~~~~~ -!!! error TS2339: Property 'asyncMethod' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols index 0cb5153a25..708f1368d3 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols @@ -7,9 +7,13 @@ export const Adapter = {}; >Adapter : Symbol(Adapter, Decl(a.js, 2, 12)) Adapter.prop = {}; +>Adapter.prop : Symbol(prop, Decl(a.js, 2, 26)) >Adapter : Symbol(Adapter, Decl(a.js, 2, 12)) +>prop : Symbol(prop, Decl(a.js, 2, 26)) // comment this out, and it works Adapter.asyncMethod = function() {} +>Adapter.asyncMethod : Symbol(asyncMethod, Decl(a.js, 4, 18)) >Adapter : Symbol(Adapter, Decl(a.js, 2, 12)) +>asyncMethod : Symbol(asyncMethod, Decl(a.js, 4, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols.diff index d409b50d79..d2e2632bfd 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.symbols.diff @@ -11,11 +11,15 @@ ->Adapter.prop : Symbol(Adapter.prop, Decl(a.js, 2, 26)) ->Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 2, 26), Decl(a.js, 4, 18)) ->prop : Symbol(Adapter.prop, Decl(a.js, 2, 26)) ++>Adapter.prop : Symbol(prop, Decl(a.js, 2, 26)) +>Adapter : Symbol(Adapter, Decl(a.js, 2, 12)) ++>prop : Symbol(prop, Decl(a.js, 2, 26)) // comment this out, and it works Adapter.asyncMethod = function() {} ->Adapter.asyncMethod : Symbol(Adapter.asyncMethod, Decl(a.js, 4, 18)) ->Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 2, 26), Decl(a.js, 4, 18)) ->asyncMethod : Symbol(Adapter.asyncMethod, Decl(a.js, 4, 18)) ++>Adapter.asyncMethod : Symbol(asyncMethod, Decl(a.js, 4, 18)) +>Adapter : Symbol(Adapter, Decl(a.js, 2, 12)) ++>asyncMethod : Symbol(asyncMethod, Decl(a.js, 4, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.types index d0d66055b6..f119d20f37 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignmentWithExport.types @@ -4,21 +4,21 @@ // this is a javascript file... export const Adapter = {}; ->Adapter : {} ->{} : {} +>Adapter : { prop: {}; asyncMethod: () => void; } +>{} : { prop: {}; asyncMethod: () => void; } Adapter.prop = {}; >Adapter.prop = {} : {} ->Adapter.prop : any ->Adapter : {} ->prop : any +>Adapter.prop : {} +>Adapter : { prop: {}; asyncMethod: () => void; } +>prop : {} >{} : {} // comment this out, and it works Adapter.asyncMethod = function() {} >Adapter.asyncMethod = function() {} : () => void ->Adapter.asyncMethod : any ->Adapter : {} ->asyncMethod : any +>Adapter.asyncMethod : () => void +>Adapter : { prop: {}; asyncMethod: () => void; } +>asyncMethod : () => void >function() {} : () => void diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.errors.txt index abf886de94..710c3c0472 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.errors.txt @@ -3,10 +3,17 @@ a.js(6,5): error TS2683: 'this' implicitly has type 'any' because it does not ha a.js(7,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(8,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(9,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(14,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(17,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(20,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(23,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(27,20): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(28,10): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(31,10): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. a.js(34,10): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== a.js (6 errors) ==== +==== a.js (13 errors) ==== // all references to _map, set, get, addon should be ok /** @constructor */ @@ -31,23 +38,37 @@ a.js(34,10): error TS7009: 'new' expression, whose target lacks a construct sign Multimap.prototype = { set: function() { this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. }, get() { this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } } Multimap.prototype.addon = function () { + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols index 041fb39b4a..8cb19b1902 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols @@ -15,37 +15,71 @@ var Multimap = function() { }; Multimap.prototype = { ->Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Multimap.prototype : Symbol(prototype, Decl(a.js, 9, 2)) >Multimap : Symbol(Multimap, Decl(a.js, 3, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(a.js, 9, 2)) set: function() { >set : Symbol(set, Decl(a.js, 11, 22)) this._map +>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set +>this.set : Symbol(set, Decl(a.js, 11, 22)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>set : Symbol(set, Decl(a.js, 11, 22)) + this.get +>this.get : Symbol(get, Decl(a.js, 17, 6)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>get : Symbol(get, Decl(a.js, 17, 6)) + this.addon +>this : Symbol(þobject, Decl(a.js, 11, 20)) + }, get() { >get : Symbol(get, Decl(a.js, 17, 6)) this._map +>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set +>this.set : Symbol(set, Decl(a.js, 11, 22)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>set : Symbol(set, Decl(a.js, 11, 22)) + this.get +>this.get : Symbol(get, Decl(a.js, 17, 6)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>get : Symbol(get, Decl(a.js, 17, 6)) + this.addon +>this : Symbol(þobject, Decl(a.js, 11, 20)) } } Multimap.prototype.addon = function () { ->Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Multimap.prototype : Symbol(prototype, Decl(a.js, 9, 2)) >Multimap : Symbol(Multimap, Decl(a.js, 3, 3)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(a.js, 9, 2)) this._map +>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set +>this.set : Symbol(set, Decl(a.js, 11, 22)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>set : Symbol(set, Decl(a.js, 11, 22)) + this.get +>this.get : Symbol(get, Decl(a.js, 17, 6)) +>this : Symbol(þobject, Decl(a.js, 11, 20)) +>get : Symbol(get, Decl(a.js, 17, 6)) + this.addon +>this : Symbol(þobject, Decl(a.js, 11, 20)) } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols.diff index 04cdca8d2d..f3f6627dfb 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.symbols.diff @@ -38,9 +38,9 @@ ->Multimap.prototype : Symbol(Multimap.prototype, Decl(a.js, 9, 2)) ->Multimap : Symbol(Multimap, Decl(a.js, 3, 3), Decl(a.js, 9, 2)) ->prototype : Symbol(Multimap.prototype, Decl(a.js, 9, 2)) -+>Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Multimap.prototype : Symbol(prototype, Decl(a.js, 9, 2)) +>Multimap : Symbol(Multimap, Decl(a.js, 3, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(a.js, 9, 2)) set: function() { >set : Symbol(set, Decl(a.js, 11, 22)) @@ -49,22 +49,26 @@ ->this._map : Symbol(Multimap._map, Decl(a.js, 3, 27)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->_map : Symbol(Multimap._map, Decl(a.js, 3, 27)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set -->this.set : Symbol(set, Decl(a.js, 11, 22)) + >this.set : Symbol(set, Decl(a.js, 11, 22)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->set : Symbol(set, Decl(a.js, 11, 22)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >set : Symbol(set, Decl(a.js, 11, 22)) + this.get -->this.get : Symbol(get, Decl(a.js, 17, 6)) + >this.get : Symbol(get, Decl(a.js, 17, 6)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->get : Symbol(get, Decl(a.js, 17, 6)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >get : Symbol(get, Decl(a.js, 17, 6)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + }, get() { >get : Symbol(get, Decl(a.js, 17, 6)) @@ -73,21 +77,25 @@ ->this._map : Symbol(Multimap._map, Decl(a.js, 3, 27)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->_map : Symbol(Multimap._map, Decl(a.js, 3, 27)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set -->this.set : Symbol(set, Decl(a.js, 11, 22)) + >this.set : Symbol(set, Decl(a.js, 11, 22)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->set : Symbol(set, Decl(a.js, 11, 22)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >set : Symbol(set, Decl(a.js, 11, 22)) + this.get -->this.get : Symbol(get, Decl(a.js, 17, 6)) + >this.get : Symbol(get, Decl(a.js, 17, 6)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->get : Symbol(get, Decl(a.js, 17, 6)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >get : Symbol(get, Decl(a.js, 17, 6)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) ++>this : Symbol(þobject, Decl(a.js, 11, 20)) } } @@ -96,29 +104,33 @@ ->Multimap : Symbol(Multimap, Decl(a.js, 3, 3), Decl(a.js, 9, 2)) ->prototype : Symbol(Multimap.prototype, Decl(a.js, 9, 2)) ->addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) -+>Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Multimap.prototype : Symbol(prototype, Decl(a.js, 9, 2)) +>Multimap : Symbol(Multimap, Decl(a.js, 3, 3)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(a.js, 9, 2)) this._map ->this._map : Symbol(Multimap._map, Decl(a.js, 3, 27)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->_map : Symbol(Multimap._map, Decl(a.js, 3, 27)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + this.set -->this.set : Symbol(set, Decl(a.js, 11, 22)) + >this.set : Symbol(set, Decl(a.js, 11, 22)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->set : Symbol(set, Decl(a.js, 11, 22)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >set : Symbol(set, Decl(a.js, 11, 22)) + this.get -->this.get : Symbol(get, Decl(a.js, 17, 6)) + >this.get : Symbol(get, Decl(a.js, 17, 6)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) -->get : Symbol(get, Decl(a.js, 17, 6)) -- ++>this : Symbol(þobject, Decl(a.js, 11, 20)) + >get : Symbol(get, Decl(a.js, 17, 6)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) ->this : Symbol(Multimap, Decl(a.js, 3, 14)) ->addon : Symbol(Multimap.addon, Decl(a.js, 24, 1)) ++>this : Symbol(þobject, Decl(a.js, 11, 20)) } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.types b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.types index 7dc5427ec1..bb2f7fe42a 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment.types @@ -5,8 +5,8 @@ /** @constructor */ var Multimap = function() { ->Multimap : () => void ->function() { this._map = {}; this._map this.set this.get this.addon} : () => void +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>function() { this._map = {}; this._map this.set this.get this.addon} : { (): void; prototype: { set: () => void; get(): void; }; } this._map = {}; >this._map = {} : {} @@ -39,9 +39,9 @@ var Multimap = function() { Multimap.prototype = { >Multimap.prototype = { set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon }} : { set: () => void; get(): void; } ->Multimap.prototype : any ->Multimap : () => void ->prototype : any +>Multimap.prototype : { set: () => void; get(): void; } +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>prototype : { set: () => void; get(): void; } >{ set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon }} : { set: () => void; get(): void; } set: function() { @@ -50,22 +50,22 @@ Multimap.prototype = { this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any }, @@ -74,22 +74,22 @@ Multimap.prototype = { this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any } } @@ -97,37 +97,37 @@ Multimap.prototype = { Multimap.prototype.addon = function () { >Multimap.prototype.addon = function () { this._map this.set this.get this.addon} : () => void >Multimap.prototype.addon : any ->Multimap.prototype : any ->Multimap : () => void ->prototype : any +>Multimap.prototype : { set: () => void; get(): void; } +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>prototype : { set: () => void; get(): void; } >addon : any >function () { this._map this.set this.get this.addon} : () => void this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any } var mm = new Multimap(); >mm : any >new Multimap() : any ->Multimap : () => void +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } mm._map >mm._map : any diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.errors.txt index 1e6ac4335f..af1c515bee 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.errors.txt @@ -3,10 +3,17 @@ a.js(7,9): error TS2683: 'this' implicitly has type 'any' because it does not ha a.js(8,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(9,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. a.js(10,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(15,18): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(18,18): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(21,18): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(24,18): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(28,24): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(29,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. +a.js(32,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. a.js(35,14): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== a.js (6 errors) ==== +==== a.js (13 errors) ==== // non top-level: // all references to _map, set, get, addon should be ok (function container() { @@ -32,23 +39,37 @@ a.js(35,14): error TS7009: 'new' expression, whose target lacks a construct sign Multimap.prototype = { set: function() { this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. }, get() { this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } } Multimap.prototype.addon = function () { + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. this._map + ~~~~ +!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get this.addon + ~~~~~ +!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols index 705a5da9c2..c47139193a 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols @@ -18,37 +18,71 @@ }; Multimap.prototype = { ->Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Multimap.prototype : Symbol(prototype, Decl(a.js, 10, 6)) >Multimap : Symbol(Multimap, Decl(a.js, 4, 7)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(a.js, 10, 6)) set: function() { >set : Symbol(set, Decl(a.js, 12, 26)) this._map +>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set +>this.set : Symbol(set, Decl(a.js, 12, 26)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>set : Symbol(set, Decl(a.js, 12, 26)) + this.get +>this.get : Symbol(get, Decl(a.js, 18, 10)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>get : Symbol(get, Decl(a.js, 18, 10)) + this.addon +>this : Symbol(þobject, Decl(a.js, 12, 24)) + }, get() { >get : Symbol(get, Decl(a.js, 18, 10)) this._map +>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set +>this.set : Symbol(set, Decl(a.js, 12, 26)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>set : Symbol(set, Decl(a.js, 12, 26)) + this.get +>this.get : Symbol(get, Decl(a.js, 18, 10)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>get : Symbol(get, Decl(a.js, 18, 10)) + this.addon +>this : Symbol(þobject, Decl(a.js, 12, 24)) } } Multimap.prototype.addon = function () { ->Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Multimap.prototype : Symbol(prototype, Decl(a.js, 10, 6)) >Multimap : Symbol(Multimap, Decl(a.js, 4, 7)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(prototype, Decl(a.js, 10, 6)) this._map +>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set +>this.set : Symbol(set, Decl(a.js, 12, 26)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>set : Symbol(set, Decl(a.js, 12, 26)) + this.get +>this.get : Symbol(get, Decl(a.js, 18, 10)) +>this : Symbol(þobject, Decl(a.js, 12, 24)) +>get : Symbol(get, Decl(a.js, 18, 10)) + this.addon +>this : Symbol(þobject, Decl(a.js, 12, 24)) } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols.diff index 83774d1998..f56d2a9918 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.symbols.diff @@ -32,10 +32,10 @@ Multimap.prototype = { ->Multimap.prototype : Symbol(Multimap.prototype, Decl(a.js, 10, 6)) -+>Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Multimap.prototype : Symbol(prototype, Decl(a.js, 10, 6)) >Multimap : Symbol(Multimap, Decl(a.js, 4, 7)) ->prototype : Symbol(Multimap.prototype, Decl(a.js, 10, 6)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(a.js, 10, 6)) set: function() { >set : Symbol(set, Decl(a.js, 12, 26)) @@ -44,22 +44,26 @@ ->this._map : Symbol(Multimap._map, Decl(a.js, 4, 31)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->_map : Symbol(Multimap._map, Decl(a.js, 4, 31)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set -->this.set : Symbol(set, Decl(a.js, 12, 26)) + >this.set : Symbol(set, Decl(a.js, 12, 26)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->set : Symbol(set, Decl(a.js, 12, 26)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >set : Symbol(set, Decl(a.js, 12, 26)) + this.get -->this.get : Symbol(get, Decl(a.js, 18, 10)) + >this.get : Symbol(get, Decl(a.js, 18, 10)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->get : Symbol(get, Decl(a.js, 18, 10)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >get : Symbol(get, Decl(a.js, 18, 10)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + }, get() { >get : Symbol(get, Decl(a.js, 18, 10)) @@ -68,55 +72,63 @@ ->this._map : Symbol(Multimap._map, Decl(a.js, 4, 31)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->_map : Symbol(Multimap._map, Decl(a.js, 4, 31)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set -->this.set : Symbol(set, Decl(a.js, 12, 26)) + >this.set : Symbol(set, Decl(a.js, 12, 26)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->set : Symbol(set, Decl(a.js, 12, 26)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >set : Symbol(set, Decl(a.js, 12, 26)) + this.get -->this.get : Symbol(get, Decl(a.js, 18, 10)) + >this.get : Symbol(get, Decl(a.js, 18, 10)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->get : Symbol(get, Decl(a.js, 18, 10)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >get : Symbol(get, Decl(a.js, 18, 10)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) ++>this : Symbol(þobject, Decl(a.js, 12, 24)) } } Multimap.prototype.addon = function () { ->Multimap.prototype : Symbol(Multimap.addon, Decl(a.js, 25, 5)) -+>Multimap.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>Multimap.prototype : Symbol(prototype, Decl(a.js, 10, 6)) >Multimap : Symbol(Multimap, Decl(a.js, 4, 7)) ->prototype : Symbol(Multimap.prototype, Decl(a.js, 10, 6)) ->addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) -+>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>prototype : Symbol(prototype, Decl(a.js, 10, 6)) this._map ->this._map : Symbol(Multimap._map, Decl(a.js, 4, 31)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->_map : Symbol(Multimap._map, Decl(a.js, 4, 31)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + this.set -->this.set : Symbol(set, Decl(a.js, 12, 26)) + >this.set : Symbol(set, Decl(a.js, 12, 26)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->set : Symbol(set, Decl(a.js, 12, 26)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >set : Symbol(set, Decl(a.js, 12, 26)) + this.get -->this.get : Symbol(get, Decl(a.js, 18, 10)) + >this.get : Symbol(get, Decl(a.js, 18, 10)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) -->get : Symbol(get, Decl(a.js, 18, 10)) -- ++>this : Symbol(þobject, Decl(a.js, 12, 24)) + >get : Symbol(get, Decl(a.js, 18, 10)) + this.addon ->this.addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) ->this : Symbol(Multimap, Decl(a.js, 4, 18)) ->addon : Symbol(Multimap.addon, Decl(a.js, 25, 5)) ++>this : Symbol(þobject, Decl(a.js, 12, 24)) } var mm = new Multimap(); -@@= skipped -112, +45 lines =@@ +@@= skipped -112, +79 lines =@@ >Multimap : Symbol(Multimap, Decl(a.js, 4, 7)) mm._map diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.types b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.types index 6a72114888..1f22dd1cef 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPrototypeAssignment2.types @@ -10,8 +10,8 @@ /** @constructor */ var Multimap = function() { ->Multimap : () => void ->function() { this._map = {}; this._map this.set this.get this.addon } : () => void +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>function() { this._map = {}; this._map this.set this.get this.addon } : { (): void; prototype: { set: () => void; get(): void; }; } this._map = {}; >this._map = {} : {} @@ -44,9 +44,9 @@ Multimap.prototype = { >Multimap.prototype = { set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon } } : { set: () => void; get(): void; } ->Multimap.prototype : any ->Multimap : () => void ->prototype : any +>Multimap.prototype : { set: () => void; get(): void; } +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>prototype : { set: () => void; get(): void; } >{ set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon } } : { set: () => void; get(): void; } set: function() { @@ -55,22 +55,22 @@ this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any }, @@ -79,22 +79,22 @@ this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any } } @@ -102,37 +102,37 @@ Multimap.prototype.addon = function () { >Multimap.prototype.addon = function () { this._map this.set this.get this.addon } : () => void >Multimap.prototype.addon : any ->Multimap.prototype : any ->Multimap : () => void ->prototype : any +>Multimap.prototype : { set: () => void; get(): void; } +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } +>prototype : { set: () => void; get(): void; } >addon : any >function () { this._map this.set this.get this.addon } : () => void this._map >this._map : any ->this : any +>this : { set: () => void; get(): void; } >_map : any this.set ->this.set : any ->this : any ->set : any +>this.set : () => void +>this : { set: () => void; get(): void; } +>set : () => void this.get ->this.get : any ->this : any ->get : any +>this.get : () => void +>this : { set: () => void; get(): void; } +>get : () => void this.addon >this.addon : any ->this : any +>this : { set: () => void; get(): void; } >addon : any } var mm = new Multimap(); >mm : any >new Multimap() : any ->Multimap : () => void +>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } mm._map >mm._map : any diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt index cc76ff4dfb..cb8b1e13b1 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt @@ -1,13 +1,10 @@ -mod2.js(3,4): error TS2339: Property 'Foo' does not exist on type '{}'. mod2.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== mod2.js (2 errors) ==== +==== mod2.js (1 errors) ==== /** @typedef {number} Foo */ const ns = {}; ns.Foo = class {} - ~~~ -!!! error TS2339: Property 'Foo' does not exist on type '{}'. module.exports = ns; ~~~~~~~~~~~~~~~~~~~ !!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols index 903e7274bb..55b621c775 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols @@ -6,7 +6,9 @@ const ns = {}; >ns : Symbol(ns, Decl(mod2.js, 1, 5)) ns.Foo = class {} +>ns.Foo : Symbol(Foo, Decl(mod2.js, 1, 14)) >ns : Symbol(ns, Decl(mod2.js, 1, 5)) +>Foo : Symbol(Foo, Decl(mod2.js, 1, 14)) module.exports = ns; >module.exports : Symbol(ns, Decl(mod2.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff index dda3b70987..31e98d5c03 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff @@ -11,7 +11,9 @@ ->ns.Foo : Symbol(Foo, Decl(mod2.js, 1, 14), Decl(mod2.js, 0, 4)) ->ns : Symbol(ns, Decl(mod2.js, 1, 5), Decl(mod2.js, 1, 14)) ->Foo : Symbol(Foo, Decl(mod2.js, 1, 14), Decl(mod2.js, 0, 4)) ++>ns.Foo : Symbol(Foo, Decl(mod2.js, 1, 14)) +>ns : Symbol(ns, Decl(mod2.js, 1, 5)) ++>Foo : Symbol(Foo, Decl(mod2.js, 1, 14)) module.exports = ns; ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types index 2cd97df031..86a2a85ca8 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types @@ -3,21 +3,21 @@ === mod2.js === /** @typedef {number} Foo */ const ns = {}; ->ns : {} ->{} : {} +>ns : { Foo: typeof Foo; } +>{} : { Foo: typeof Foo; } ns.Foo = class {} >ns.Foo = class {} : typeof Foo ->ns.Foo : any ->ns : {} ->Foo : any +>ns.Foo : typeof Foo +>ns : { Foo: typeof Foo; } +>Foo : typeof Foo >class {} : typeof Foo module.exports = ns; ->module.exports = ns : {} ->module.exports : {} ->module : { readonly ns: {}; } ->exports : {} ->ns : {} +>module.exports = ns : { Foo: typeof Foo; } +>module.exports : { Foo: typeof Foo; } +>module : { readonly ns: { Foo: typeof Foo; }; } +>exports : { Foo: typeof Foo; } +>ns : { Foo: typeof Foo; } diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.errors.txt.diff index 935b1d0489..b6cb604258 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.errors.txt.diff @@ -5,27 +5,18 @@ - - -==== index.js (1 errors) ==== -+index.js(4,3): error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -+index.js(9,23): error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -+ -+ -+==== index.js (2 errors) ==== - class C { - static blah1 = 123; - } - C.blah2 = 456; -+ ~~~~~ -+!!! error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -+!!! related TS2728 index.js:2:10: 'blah1' is declared here. - - class D extends C { - static { - console.log(super.blah1); - console.log(super.blah2); - ~~~~~ +- class C { +- static blah1 = 123; +- } +- C.blah2 = 456; +- +- class D extends C { +- static { +- console.log(super.blah1); +- console.log(super.blah2); +- ~~~~~ -!!! error TS2565: Property 'blah2' is used before being assigned. -+!!! error TS2551: Property 'blah2' does not exist on type 'typeof C'. Did you mean 'blah1'? -+!!! related TS2728 index.js:2:10: 'blah1' is declared here. - } - } - \ No newline at end of file +- } +- } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.types.diff deleted file mode 100644 index 0992c1aa5a..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/classFieldSuperAccessibleJs1.types.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.classFieldSuperAccessibleJs1.types -+++ new.classFieldSuperAccessibleJs1.types -@@= skipped -9, +9 lines =@@ - } - C.blah2 = 456; - >C.blah2 = 456 : 456 -->C.blah2 : number -+>C.blah2 : any - >C : typeof C -->blah2 : number -+>blah2 : any - >456 : 456 - - class D extends C { -@@= skipped -24, +24 lines =@@ - >console.log : (...data: any[]) => void - >console : Console - >log : (...data: any[]) => void -->super.blah2 : number -+>super.blah2 : any - >super : typeof C -->blah2 : number -+>blah2 : any - } - } diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff index d1e80970aa..474ee3e6d7 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff @@ -7,9 +7,7 @@ - -==== index.js (0 errors) ==== +index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+namespacer.js(2,3): error TS2339: Property 'NS' does not exist on type '{}'. +namespacer.js(2,8): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+namespacey.js(2,3): error TS2339: Property 'bar' does not exist on type '{}'. + + +==== index.js (1 errors) ==== @@ -19,20 +17,16 @@ + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. --==== namespacey.js (0 errors) ==== -+==== namespacey.js (1 errors) ==== + ==== namespacey.js (0 errors) ==== const A = {} A.bar = class Q {} -+ ~~~ -+!!! error TS2339: Property 'bar' does not exist on type '{}'. module.exports = A; - ==== namespacer.js (2 errors) ==== +-==== namespacer.js (2 errors) ==== ++==== namespacer.js (1 errors) ==== const B = {} B.NS = require("./namespacey"); - ~~~~ -!!! error TS2323: Cannot redeclare exported variable 'NS'. -+ ~~ -+!!! error TS2339: Property 'NS' does not exist on type '{}'. + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(B, "NS", { value: "why though", writable: true }); diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff index a3bd6ade39..c4294aad68 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff @@ -6,8 +6,8 @@ const _item = require("./namespacer"); ->_item : typeof _item ->require("./namespacer") : typeof _item -+>_item : {} -+>require("./namespacer") : {} ++>_item : { NS: any; } ++>require("./namespacer") : { NS: any; } >require : any >"./namespacer" : "./namespacer" @@ -38,17 +38,16 @@ === namespacey.js === const A = {} ->A : typeof A -+>A : {} - >{} : {} +->{} : {} ++>A : { bar: typeof Q; } ++>{} : { bar: typeof Q; } A.bar = class Q {} >A.bar = class Q {} : typeof Q -->A.bar : typeof Q + >A.bar : typeof Q ->A : typeof A -->bar : typeof Q -+>A.bar : any -+>A : {} -+>bar : any ++>A : { bar: typeof Q; } + >bar : typeof Q >class Q {} : typeof Q >Q : typeof Q @@ -58,17 +57,18 @@ ->module : { exports: typeof A; } ->exports : typeof A ->A : typeof A -+>module.exports = A : {} -+>module.exports : {} -+>module : { readonly A: {}; } -+>exports : {} -+>A : {} ++>module.exports = A : { bar: typeof Q; } ++>module.exports : { bar: typeof Q; } ++>module : { readonly A: { bar: typeof Q; }; } ++>exports : { bar: typeof Q; } ++>A : { bar: typeof Q; } === namespacer.js === const B = {} ->B : typeof B -+>B : {} - >{} : {} +->{} : {} ++>B : { NS: any; } ++>{} : { NS: any; } B.NS = require("./namespacey"); ->B.NS = require("./namespacey") : typeof A @@ -78,7 +78,7 @@ ->require("./namespacey") : typeof A +>B.NS = require("./namespacey") : any +>B.NS : any -+>B : {} ++>B : { NS: any; } +>NS : any +>require("./namespacey") : any >require : any @@ -86,12 +86,12 @@ Object.defineProperty(B, "NS", { value: "why though", writable: true }); ->Object.defineProperty(B, "NS", { value: "why though", writable: true }) : typeof B -+>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : {} ++>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : { NS: any; } >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->B : typeof B -+>B : {} ++>B : { NS: any; } >"NS" : "NS" >{ value: "why though", writable: true } : { value: string; writable: true; } >value : string @@ -104,8 +104,8 @@ ->module : { exports: typeof B; } ->exports : typeof B ->B : typeof B -+>module.exports = B : {} -+>module.exports : {} -+>module : { readonly B: {}; } -+>exports : {} -+>B : {} ++>module.exports = B : { NS: any; } ++>module.exports : { NS: any; } ++>module : { readonly B: { NS: any; }; } ++>exports : { NS: any; } ++>B : { NS: any; } diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.errors.txt.diff index 80609e43da..9cc83c3f2b 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.errors.txt.diff @@ -2,21 +2,17 @@ +++ new.jsElementAccessNoContextualTypeCrash.errors.txt @@= skipped -0, +0 lines =@@ -jsElementAccessNoContextualTypeCrash.js(2,1): error TS2741: Property 'localize' is missing in type '{}' but required in type 'typeof Common'. -+jsElementAccessNoContextualTypeCrash.js(7,8): error TS2339: Property 'localize' does not exist on type '{}'. ++jsElementAccessNoContextualTypeCrash.js(2,1): error TS2322: Type '{ localize: (string: any) => any; } | {}' is not assignable to type '{ localize: (string: any) => any; }'. ++ Property 'localize' is missing in type '{}' but required in type '{ localize: (string: any) => any; }'. ==== jsElementAccessNoContextualTypeCrash.js (1 errors) ==== var Common = {}; self['Common'] = self['Common'] || {}; -- ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ -!!! error TS2741: Property 'localize' is missing in type '{}' but required in type 'typeof Common'. --!!! related TS2728 jsElementAccessNoContextualTypeCrash.js:7:1: 'localize' is declared here. ++!!! error TS2322: Type '{ localize: (string: any) => any; } | {}' is not assignable to type '{ localize: (string: any) => any; }'. ++!!! error TS2322: Property 'localize' is missing in type '{}' but required in type '{ localize: (string: any) => any; }'. + !!! related TS2728 jsElementAccessNoContextualTypeCrash.js:7:1: 'localize' is declared here. /** - * @param {string} string - * @return {string} - */ - Common.localize = function (string) { -+ ~~~~~~~~ -+!!! error TS2339: Property 'localize' does not exist on type '{}'. - return string; - }; \ No newline at end of file + * @param {string} string \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.types.diff index f2fc1ed5a3..90e6e551d7 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsElementAccessNoContextualTypeCrash.types.diff @@ -5,18 +5,21 @@ === jsElementAccessNoContextualTypeCrash.js === var Common = {}; ->Common : typeof Common -+>Common : {} - >{} : {} +->{} : {} ++>Common : { localize: (string: any) => any; } ++>{} : { localize: (string: any) => any; } self['Common'] = self['Common'] || {}; - >self['Common'] = self['Common'] || {} : {} +->self['Common'] = self['Common'] || {} : {} ->self['Common'] : typeof Common -+>self['Common'] : {} ++>self['Common'] = self['Common'] || {} : { localize: (string: any) => any; } | {} ++>self['Common'] : { localize: (string: any) => any; } >self : Window & typeof globalThis >'Common' : "Common" - >self['Common'] || {} : {} +->self['Common'] || {} : {} ->self['Common'] : typeof Common -+>self['Common'] : {} ++>self['Common'] || {} : { localize: (string: any) => any; } | {} ++>self['Common'] : { localize: (string: any) => any; } >self : Window & typeof globalThis >'Common' : "Common" >{} : {} @@ -31,9 +34,9 @@ ->function (string) { return string;} : (string: string) => string ->string : string +>Common.localize = function (string) { return string;} : (string: any) => any -+>Common.localize : any -+>Common : {} -+>localize : any ++>Common.localize : (string: any) => any ++>Common : { localize: (string: any) => any; } ++>localize : (string: any) => any +>function (string) { return string;} : (string: any) => any +>string : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff index dcdbc8cc60..aa131e44ee 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.errors.txt.diff @@ -2,25 +2,18 @@ +++ new.jsEnumCrossFileExport.errors.txt @@= skipped -0, +0 lines =@@ - -+enumDef.js(2,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -+enumDef.js(4,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -+enumDef.js(16,6): error TS2339: Property 'UserMetrics' does not exist on type '{}'. -+index.js(2,7): error TS2339: Property 'Cls' does not exist on type '{}'. ++enumDef.js(16,18): error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. +index.js(4,17): error TS2503: Cannot find namespace 'Host'. +index.js(8,21): error TS2304: Cannot find name 'Host'. +index.js(13,11): error TS2503: Cannot find namespace 'Host'. +index.js(18,11): error TS2503: Cannot find namespace 'Host'. + + -+==== enumDef.js (3 errors) ==== ++==== enumDef.js (1 errors) ==== + var Host = {}; + Host.UserMetrics = {}; -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. + /** @enum {number} */ + Host.UserMetrics.Action = { -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. + WindowDocked: 1, + WindowUndocked: 2, + ScriptsBreakpointSet: 3, @@ -33,15 +26,13 @@ + * @typedef {string} + */ + Host.UserMetrics.Blah = { -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'UserMetrics' does not exist on type '{}'. ++ ~~~~ ++!!! error TS2339: Property 'Blah' does not exist on type '{ Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }'. + x: 12 + } -+==== index.js (5 errors) ==== ++==== index.js (4 errors) ==== + var Other = {}; + Other.Cls = class { -+ ~~~ -+!!! error TS2339: Property 'Cls' does not exist on type '{}'. + /** + * @param {!Host.UserMetrics.Action} p + ~~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.types.diff index b6e157fcb3..6acccc05c0 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumCrossFileExport.types.diff @@ -5,36 +5,35 @@ === enumDef.js === var Host = {}; ->Host : typeof Host -+>Host : {} - >{} : {} +->{} : {} ++>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } ++>{} : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } Host.UserMetrics = {}; ->Host.UserMetrics = {} : typeof Host.UserMetrics ->Host.UserMetrics : typeof Host.UserMetrics ->Host : typeof Host ->UserMetrics : typeof Host.UserMetrics -+>Host.UserMetrics = {} : {} -+>Host.UserMetrics : any -+>Host : {} -+>UserMetrics : any - >{} : {} +->{} : {} ++>Host.UserMetrics = {} : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } ++>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } ++>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } ++>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } ++>{} : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } /** @enum {number} */ Host.UserMetrics.Action = { >Host.UserMetrics.Action = { WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, TimelineStarted: 4,} : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } -->Host.UserMetrics.Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } + >Host.UserMetrics.Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } ->Host.UserMetrics : typeof Host.UserMetrics ->Host : typeof Host ->UserMetrics : typeof Host.UserMetrics -->Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } -+>Host.UserMetrics.Action : any -+>Host.UserMetrics : any -+>Host : {} -+>UserMetrics : any -+>Action : any ++>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } ++>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } ++>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } + >Action : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } >{ WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, TimelineStarted: 4,} : { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; } - WindowDocked: 1, @@= skipped -45, +45 lines =@@ */ Host.UserMetrics.Blah = { @@ -45,9 +44,9 @@ ->UserMetrics : typeof Host.UserMetrics ->Blah : { x: number; } +>Host.UserMetrics.Blah : any -+>Host.UserMetrics : any -+>Host : {} -+>UserMetrics : any ++>Host.UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } ++>Host : { UserMetrics: { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; }; } ++>UserMetrics : { Action: { WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; }; } +>Blah : any >{ x: 12} : { x: number; } @@ -57,20 +56,18 @@ === index.js === var Other = {}; ->Other : typeof Other -+>Other : {} - >{} : {} +->{} : {} ++>Other : { Cls: typeof Cls; } ++>{} : { Cls: typeof Cls; } Other.Cls = class { >Other.Cls = class { /** * @param {!Host.UserMetrics.Action} p */ method(p) {} usage() { this.method(Host.UserMetrics.Action.WindowDocked); }} : typeof Cls -->Other.Cls : typeof Cls + >Other.Cls : typeof Cls ->Other : typeof Other -->Cls : typeof Cls -+>Other.Cls : any -+>Other : {} -+>Cls : any ++>Other : { Cls: typeof Cls; } + >Cls : typeof Cls >class { /** * @param {!Host.UserMetrics.Action} p */ method(p) {} usage() { this.method(Host.UserMetrics.Action.WindowDocked); }} : typeof Cls - /** @@= skipped -15, +15 lines =@@ */ method(p) {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff index 9687140026..c452532703 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff @@ -7,33 +7,26 @@ -assignmentToVoidZero2.js(10,10): error TS2339: Property 'q' does not exist on type 'C'. -assignmentToVoidZero2.js(13,9): error TS2339: Property 'q' does not exist on type 'C'. -importer.js(1,13): error TS2305: Module '"./assignmentToVoidZero2"' has no exported member 'k'. -+assignmentToVoidZero2.js(4,3): error TS2339: Property 'x' does not exist on type '{}'. -+assignmentToVoidZero2.js(5,3): error TS2339: Property 'y' does not exist on type '{}'. -+assignmentToVoidZero2.js(6,3): error TS2339: Property 'x' does not exist on type '{}'. -+assignmentToVoidZero2.js(6,9): error TS2339: Property 'y' does not exist on type '{}'. +- +- +-==== assignmentToVoidZero2.js (5 errors) ==== +assignmentToVoidZero2.js(12,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +importer.js(2,1): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. - - - ==== assignmentToVoidZero2.js (5 errors) ==== ++ ++ ++==== assignmentToVoidZero2.js (1 errors) ==== exports.j = 1; exports.k = void 0; - ~ -!!! error TS2339: Property 'k' does not exist on type 'typeof import("assignmentToVoidZero2")'. var o = {} o.x = 1 -+ ~ -+!!! error TS2339: Property 'x' does not exist on type '{}'. o.y = void 0 - ~ +- ~ -!!! error TS2339: Property 'y' does not exist on type 'typeof o'. -+!!! error TS2339: Property 'y' does not exist on type '{}'. o.x + o.y -+ ~ -+!!! error TS2339: Property 'x' does not exist on type '{}'. - ~ +- ~ -!!! error TS2339: Property 'y' does not exist on type 'typeof o'. -+!!! error TS2339: Property 'y' does not exist on type '{}'. function C() { this.p = 1 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff index d030068407..bf4495db2c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff @@ -22,39 +22,36 @@ var o = {} ->o : typeof o -+>o : {} - >{} : {} +->{} : {} ++>o : { x: number; y: any; } ++>{} : { x: number; y: any; } o.x = 1 >o.x = 1 : 1 -->o.x : number + >o.x : number ->o : typeof o -->x : number -+>o.x : any -+>o : {} -+>x : any ++>o : { x: number; y: any; } + >x : number >1 : 1 o.y = void 0 >o.y = void 0 : undefined >o.y : any ->o : typeof o -+>o : {} ++>o : { x: number; y: any; } >y : any >void 0 : undefined >0 : 0 - +@@= skipped -34, +34 lines =@@ o.x + o.y >o.x + o.y : any -->o.x : number + >o.x : number ->o : typeof o -->x : number -+>o.x : any -+>o : {} -+>x : any ++>o : { x: number; y: any; } + >x : number >o.y : any ->o : typeof o -+>o : {} ++>o : { x: number; y: any; } >y : any function C() { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff index ebbd0e2086..850f92019d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff @@ -9,10 +9,10 @@ ->mod.A : typeof A +>a : any +>new mod.A() : any -+>mod.A : () => void ++>mod.A : { (): void; prototype: { m(n: number): number; }; } >mod : typeof mod ->A : typeof A -+>A : () => void ++>A : { (): void; prototype: { m(n: number): number; }; } var b = new mod.B() ->b : B @@ -20,10 +20,10 @@ ->mod.B : typeof B +>b : any +>new mod.B() : any -+>mod.B : () => void ++>mod.B : { (): void; prototype: { m(n: number): number; }; } >mod : typeof mod ->B : typeof B -+>B : () => void ++>B : { (): void; prototype: { m(n: number): number; }; } a.m('nope') ->a.m('nope') : number @@ -55,9 +55,9 @@ ->A : typeof A ->function A() { this.a = 1} : typeof A ->A : typeof A -+>A : () => void -+>function A() { this.a = 1} : () => void -+>A : () => void ++>A : { (): void; prototype: { m(n: number): number; }; } ++>function A() { this.a = 1} : { (): void; prototype: { m(n: number): number; }; } ++>A : { (): void; prototype: { m(n: number): number; }; } this.a = 1 >this.a = 1 : 1 @@ -71,9 +71,9 @@ ->B : typeof B ->function B() { this.b = 2} : typeof B ->B : typeof B -+>B : () => void -+>function B() { this.b = 2} : () => void -+>B : () => void ++>B : { (): void; prototype: { m(n: number): number; }; } ++>function B() { this.b = 2} : { (): void; prototype: { m(n: number): number; }; } ++>B : { (): void; prototype: { m(n: number): number; }; } this.b = 2 >this.b = 2 : 2 @@ -89,11 +89,11 @@ ->exports : typeof import("mod") ->A : typeof A ->A : typeof A -+>exports.A = A : () => void -+>exports.A : () => void ++>exports.A = A : { (): void; prototype: { m(n: number): number; }; } ++>exports.A : { (): void; prototype: { m(n: number): number; }; } +>exports : typeof import("./mod") -+>A : () => void -+>A : () => void ++>A : { (): void; prototype: { m(n: number): number; }; } ++>A : { (): void; prototype: { m(n: number): number; }; } exports.B = B ->exports.B = B : typeof B @@ -101,27 +101,21 @@ ->exports : typeof import("mod") ->B : typeof B ->B : typeof B -+>exports.B = B : () => void -+>exports.B : () => void ++>exports.B = B : { (): void; prototype: { m(n: number): number; }; } ++>exports.B : { (): void; prototype: { m(n: number): number; }; } +>exports : typeof import("./mod") -+>B : () => void -+>B : () => void ++>B : { (): void; prototype: { m(n: number): number; }; } ++>B : { (): void; prototype: { m(n: number): number; }; } A.prototype = B.prototype = { >A.prototype = B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } -->A.prototype : { m(n: number): number; } + >A.prototype : { m(n: number): number; } ->A : typeof A -->prototype : { m(n: number): number; } -+>A.prototype : any -+>A : () => void -+>prototype : any ++>A : { (): void; prototype: { m(n: number): number; }; } + >prototype : { m(n: number): number; } >B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } -->B.prototype : { m(n: number): number; } + >B.prototype : { m(n: number): number; } ->B : typeof B -->prototype : { m(n: number): number; } -+>B.prototype : any -+>B : () => void -+>prototype : any ++>B : { (): void; prototype: { m(n: number): number; }; } + >prototype : { m(n: number): number; } >{ /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } - - /** @param {number} n */ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.errors.txt.diff deleted file mode 100644 index 76122475dc..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.checkSpecialPropertyAssignments.errors.txt -+++ new.checkSpecialPropertyAssignments.errors.txt -@@= skipped -0, +0 lines =@@ -+bug24252.js(2,3): error TS2339: Property 'B' does not exist on type '{}'. - bug24252.js(8,9): error TS2322: Type 'string[]' is not assignable to type 'number[]'. - Type 'string' is not assignable to type 'number'. - - --==== bug24252.js (1 errors) ==== -+==== bug24252.js (2 errors) ==== - var A = {}; - A.B = class { -+ ~ -+!!! error TS2339: Property 'B' does not exist on type '{}'. - m() { - /** @type {string[]} */ - var x = []; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.types.diff index b2c48fe138..ff67ff4bce 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkSpecialPropertyAssignments.types.diff @@ -5,17 +5,14 @@ === bug24252.js === var A = {}; ->A : typeof A -+>A : {} - >{} : {} +->{} : {} ++>A : { B: typeof B; } ++>{} : { B: typeof B; } A.B = class { >A.B = class { m() { /** @type {string[]} */ var x = []; /** @type {number[]} */ var y; y = x; }} : typeof B -->A.B : typeof B + >A.B : typeof B ->A : typeof A -->B : typeof B -+>A.B : any -+>A : {} -+>B : any ++>A : { B: typeof B; } + >B : typeof B >class { m() { /** @type {string[]} */ var x = []; /** @type {number[]} */ var y; y = x; }} : typeof B - - m() { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff index 0c65fd5a56..ab343dc0e8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff @@ -3,9 +3,6 @@ @@= skipped -0, +0 lines =@@ - +main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -+mod1.js(2,4): error TS2339: Property 'K' does not exist on type '{}'. -+mod1.js(4,23): error TS2339: Property 'K' does not exist on type '{}'. -+mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. + + +==== main.js (1 errors) ==== @@ -17,18 +14,12 @@ + k.values() + } + -+==== mod1.js (3 errors) ==== ++==== mod1.js (0 errors) ==== + var NS = {} + NS.K =class { -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. + values() { + return new NS.K() -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. + } + } + exports.K = NS.K; -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff index 706ce2ea29..1d1036d7a1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff @@ -1,17 +1,15 @@ --- old.commonJSImportNestedClassTypeReference.types +++ new.commonJSImportNestedClassTypeReference.types -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === main.js === const { K } = require("./mod1"); -->K : typeof K + >K : typeof K ->require("./mod1") : typeof import("mod1") -+>K : any +>require("./mod1") : typeof import("./mod1") >require : any >"./mod1" : "./mod1" -@@= skipped -11, +11 lines =@@ +@@= skipped -10, +10 lines =@@ >k : K k.values() @@ -27,46 +25,34 @@ === mod1.js === var NS = {} ->NS : typeof NS -+>NS : {} - >{} : {} +->{} : {} ++>NS : { K: typeof K; } ++>{} : { K: typeof K; } NS.K =class { >NS.K =class { values() { return new NS.K() }} : typeof K -->NS.K : typeof K + >NS.K : typeof K ->NS : typeof NS -->K : typeof K -+>NS.K : any -+>NS : {} -+>K : any ++>NS : { K: typeof K; } + >K : typeof K >class { values() { return new NS.K() }} : typeof K - values() { -->values : () => K -+>values : () => any - +@@= skipped -24, +24 lines =@@ return new NS.K() -->new NS.K() : K -->NS.K : typeof K + >new NS.K() : K + >NS.K : typeof K ->NS : typeof NS -->K : typeof K -+>new NS.K() : any -+>NS.K : any -+>NS : {} -+>K : any ++>NS : { K: typeof K; } + >K : typeof K } } exports.K = NS.K; -->exports.K = NS.K : typeof K -->exports.K : typeof K + >exports.K = NS.K : typeof K + >exports.K : typeof K ->exports : typeof import("mod1") -->K : typeof K -->NS.K : typeof K -->NS : typeof NS -->K : typeof K -+>exports.K = NS.K : any -+>exports.K : any +>exports : typeof import("./mod1") -+>K : any -+>NS.K : any -+>NS : {} -+>K : any + >K : typeof K + >NS.K : typeof K +->NS : typeof NS ++>NS : { K: typeof K; } + >K : typeof K diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff index e8e19459fd..f38aecb74d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff @@ -2,18 +2,14 @@ +++ new.contextualTypedSpecialAssignment.errors.txt @@= skipped -0, +0 lines =@@ - -+test.js(9,4): error TS2339: Property 'x' does not exist on type '{}'. -+test.js(14,4): error TS2339: Property 'x' does not exist on type '{}'. +test.js(16,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -+test.js(18,4): error TS2339: Property 'x' does not exist on type '{}'. +test.js(33,13): error TS2322: Type 'string' is not assignable to type '"done"'. +test.js(34,15): error TS7006: Parameter 'n' implicitly has an 'any' type. +test.js(57,17): error TS2339: Property 'x' does not exist on type 'Thing'. -+test.js(59,7): error TS7006: Parameter 'n' implicitly has an 'any' type. +test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. + + -+==== test.js (9 errors) ==== ++==== test.js (5 errors) ==== + /** @typedef {{ + status: 'done' + m(n: number): void @@ -23,23 +19,17 @@ + var ns = {} + /** @type {DoneStatus} */ + ns.x = { -+ ~ -+!!! error TS2339: Property 'x' does not exist on type '{}'. + status: 'done', + m(n) { } + } + + ns.x = { -+ ~ -+!!! error TS2339: Property 'x' does not exist on type '{}'. + status: 'done', + m(n) { } + ~ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + } + ns.x -+ ~ -+!!! error TS2339: Property 'x' does not exist on type '{}'. + + + // this-property assignment @@ -88,8 +78,6 @@ +!!! error TS2339: Property 'x' does not exist on type 'Thing'. + status: 'done', + m(n) { } -+ ~ -+!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + } + Thing.prototype.x + ~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff index 603be558a0..686c26ef76 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff @@ -5,8 +5,9 @@ // property assignment var ns = {} ->ns : typeof ns -+>ns : {} - >{} : {} +->{} : {} ++>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } ++>{} : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } /** @type {DoneStatus} */ ns.x = { @@ -14,9 +15,9 @@ ->ns.x : DoneStatus ->ns : typeof ns ->x : DoneStatus -+>ns.x : any -+>ns : {} -+>x : any ++>ns.x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } ++>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } ++>x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } +>{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } >{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } @@ -31,9 +32,9 @@ ->x : DoneStatus ->{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } +>ns.x = { status: 'done', m(n) { }} : { status: string; m(n: any): void; } -+>ns.x : any -+>ns : {} -+>x : any ++>ns.x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } ++>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } ++>x : { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; } +>{ status: 'done', m(n) { }} : { status: string; m(n: any): void; } status: 'done', @@ -51,9 +52,9 @@ ->ns.x : DoneStatus ->ns : typeof ns ->x : DoneStatus -+>ns.x : any -+>ns : {} -+>x : any ++>ns.x : { status: string; m(n: any): void; } ++>ns : { x: { status: "done"; m(n: number): void; } | { status: string; m(n: any): void; }; } ++>x : { status: string; m(n: any): void; } // this-property assignment @@ -157,28 +158,20 @@ // prototype-property assignment /** @type {DoneStatus} */ Thing.prototype.x = { -->Thing.prototype.x = { status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } + >Thing.prototype.x = { status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } ->Thing.prototype.x : DoneStatus -+>Thing.prototype.x = { status: 'done', m(n) { }} : { status: string; m(n: any): void; } +>Thing.prototype.x : any >Thing.prototype : Thing >Thing : typeof Thing >prototype : Thing ->x : DoneStatus -->{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } +>x : any -+>{ status: 'done', m(n) { }} : { status: string; m(n: any): void; } ++>{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } + >{ status: 'done', m(n) { }} : { status: "done"; m(n: number): void; } status: 'done', -->status : "done" -+>status : string - >'done' : "done" - - m(n) { } -->m : (n: number) => void -->n : number -+>m : (n: any) => void -+>n : any +@@= skipped -26, +27 lines =@@ + >n : number } Thing.prototype.x ->Thing.prototype.x : DoneStatus @@ -207,7 +200,7 @@ >{ status: "done", m(n) { }} : { status: "done"; m(n: number): void; } status: "done", -@@= skipped -59, +60 lines =@@ +@@= skipped -33, +34 lines =@@ module.exports = { >module.exports = { status: "done", m(n) { }} : { status: "done"; m(n: number): void; } >module.exports : { status: "done"; m(n: number): void; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt.diff deleted file mode 100644 index d152f4c1c9..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.errors.txt.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.defaultPropertyAssignedClassWithPrototype.errors.txt -+++ new.defaultPropertyAssignedClassWithPrototype.errors.txt -@@= skipped -0, +0 lines =@@ -- -+bug39167.js(2,6): error TS2339: Property 'K' does not exist on type '{}'. -+bug39167.js(2,15): error TS2339: Property 'K' does not exist on type '{}'. -+bug39167.js(5,6): error TS2339: Property 'K' does not exist on type '{}'. -+bug39167.js(9,10): error TS2339: Property 'K' does not exist on type '{}'. -+ -+ -+==== bug39167.js (4 errors) ==== -+ var test = {}; -+ test.K = test.K || -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. -+ function () {} -+ -+ test.K.prototype = { -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. -+ add() {} -+ }; -+ -+ new test.K().add; -+ ~ -+!!! error TS2339: Property 'K' does not exist on type '{}'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.types.diff index 9941cf14ba..b13e4d6a00 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/defaultPropertyAssignedClassWithPrototype.types.diff @@ -5,8 +5,9 @@ === bug39167.js === var test = {}; ->test : typeof test -+>test : {} - >{} : {} +->{} : {} ++>test : { K: any; } ++>{} : { K: any; } test.K = test.K || ->test.K = test.K || function () {} : typeof K @@ -19,11 +20,11 @@ ->K : typeof K +>test.K = test.K || function () {} : any +>test.K : any -+>test : {} ++>test : { K: any; } +>K : any +>test.K || function () {} : any +>test.K : any -+>test : {} ++>test : { K: any; } +>K : any function () {} @@ -39,7 +40,7 @@ ->prototype : { add(): void; } +>test.K.prototype : any +>test.K : any -+>test : {} ++>test : { K: any; } +>K : any +>prototype : any >{ add() {}} : { add(): void; } @@ -58,6 +59,6 @@ +>new test.K().add : any +>new test.K() : any +>test.K : any -+>test : {} ++>test : { K: any; } +>K : any +>add : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.errors.txt.diff deleted file mode 100644 index 8dc4f4a5d8..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.errors.txt.diff +++ /dev/null @@ -1,65 +0,0 @@ ---- old.inferringClassStaticMembersFromAssignments.errors.txt -+++ new.inferringClassStaticMembersFromAssignments.errors.txt -@@= skipped -0, +0 lines =@@ -- -+b.ts(4,14): error TS2339: Property 'staticProp' does not exist on type 'typeof C1'. -+b.ts(5,14): error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. -+b.ts(7,14): error TS2339: Property 'staticProp' does not exist on type '() => void'. -+b.ts(10,12): error TS2339: Property 'staticProp' does not exist on type 'typeof C3'. -+b.ts(11,12): error TS2339: Property 'staticProp' does not exist on type 'typeof C4'. -+b.ts(13,12): error TS2339: Property 'staticProp' does not exist on type '() => void'. -+ -+ -+==== a.js (0 errors) ==== -+ export class C1 { } -+ C1.staticProp = 0; -+ -+ export function F1() { } -+ F1.staticProp = 0; -+ -+ export var C2 = class { }; -+ C2.staticProp = 0; -+ -+ export let F2 = function () { }; -+ F2.staticProp = 0; -+ -+==== global.js (0 errors) ==== -+ class C3 { } -+ C3.staticProp = 0; -+ -+ function F3() { } -+ F3.staticProp = 0; -+ -+ var C4 = class { }; -+ C4.staticProp = 0; -+ -+ let F4 = function () { }; -+ F4.staticProp = 0; -+ -+==== b.ts (6 errors) ==== -+ import * as a from "./a"; -+ var n: number; -+ -+ var n = a.C1.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C1'. -+ var n = a.C2.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. -+ var n = a.F1.staticProp; -+ var n = a.F2.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type '() => void'. -+ -+ -+ var n = C3.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C3'. -+ var n = C4.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C4'. -+ var n = F3.staticProp; -+ var n = F4.staticProp; -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type '() => void'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.types.diff index 6f932c700a..ef01485aed 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/inferringClassStaticMembersFromAssignments.types.diff @@ -1,14 +1,6 @@ --- old.inferringClassStaticMembersFromAssignments.types +++ new.inferringClassStaticMembersFromAssignments.types -@@= skipped -5, +5 lines =@@ - - C1.staticProp = 0; - >C1.staticProp = 0 : 0 -->C1.staticProp : number -+>C1.staticProp : any - >C1 : typeof C1 -->staticProp : number -+>staticProp : any +@@= skipped -11, +11 lines =@@ >0 : 0 export function F1() { } @@ -23,43 +15,7 @@ >staticProp : number >0 : 0 -@@= skipped -21, +21 lines =@@ - - C2.staticProp = 0; - >C2.staticProp = 0 : 0 -->C2.staticProp : number -+>C2.staticProp : any - >C2 : typeof C2 -->staticProp : number -+>staticProp : any - >0 : 0 - - export let F2 = function () { }; -->F2 : { (): void; staticProp: number; } -->function () { } : { (): void; staticProp: number; } -+>F2 : () => void -+>function () { } : () => void - - F2.staticProp = 0; - >F2.staticProp = 0 : 0 -->F2.staticProp : number -->F2 : { (): void; staticProp: number; } -->staticProp : number -+>F2.staticProp : any -+>F2 : () => void -+>staticProp : any - >0 : 0 - - === global.js === -@@= skipped -22, +22 lines =@@ - - C3.staticProp = 0; - >C3.staticProp = 0 : 0 -->C3.staticProp : number -+>C3.staticProp : any - >C3 : typeof C3 -->staticProp : number -+>staticProp : any +@@= skipped -43, +43 lines =@@ >0 : 0 function F3() { } @@ -74,56 +30,7 @@ >staticProp : number >0 : 0 -@@= skipped -21, +21 lines =@@ - - C4.staticProp = 0; - >C4.staticProp = 0 : 0 -->C4.staticProp : number -+>C4.staticProp : any - >C4 : typeof C4 -->staticProp : number -+>staticProp : any - >0 : 0 - - let F4 = function () { }; -->F4 : { (): void; staticProp: number; } -->function () { } : { (): void; staticProp: number; } -+>F4 : () => void -+>function () { } : () => void - - F4.staticProp = 0; - >F4.staticProp = 0 : 0 -->F4.staticProp : number -->F4 : { (): void; staticProp: number; } -->staticProp : number -+>F4.staticProp : any -+>F4 : () => void -+>staticProp : any - >0 : 0 - - === b.ts === -@@= skipped -25, +25 lines =@@ - - var n = a.C1.staticProp; - >n : number -->a.C1.staticProp : number -+>a.C1.staticProp : any - >a.C1 : typeof a.C1 - >a : typeof a - >C1 : typeof a.C1 -->staticProp : number -+>staticProp : any - - var n = a.C2.staticProp; - >n : number -->a.C2.staticProp : number -+>a.C2.staticProp : any - >a.C2 : typeof C2 - >a : typeof a - >C2 : typeof C2 -->staticProp : number -+>staticProp : any - +@@= skipped -57, +57 lines =@@ var n = a.F1.staticProp; >n : number >a.F1.staticProp : number @@ -135,34 +42,7 @@ >staticProp : number var n = a.F2.staticProp; - >n : number -->a.F2.staticProp : number -->a.F2 : { (): void; staticProp: number; } -+>a.F2.staticProp : any -+>a.F2 : () => void - >a : typeof a -->F2 : { (): void; staticProp: number; } -->staticProp : number -+>F2 : () => void -+>staticProp : any - - - var n = C3.staticProp; - >n : number -->C3.staticProp : number -+>C3.staticProp : any - >C3 : typeof C3 -->staticProp : number -+>staticProp : any - - var n = C4.staticProp; - >n : number -->C4.staticProp : number -+>C4.staticProp : any - >C4 : typeof C4 -->staticProp : number -+>staticProp : any - +@@= skipped -29, +29 lines =@@ var n = F3.staticProp; >n : number >F3.staticProp : number @@ -170,11 +50,4 @@ +>F3 : { (): void; staticProp: number; } >staticProp : number - var n = F4.staticProp; - >n : number -->F4.staticProp : number -->F4 : { (): void; staticProp: number; } -->staticProp : number -+>F4.staticProp : any -+>F4 : () => void -+>staticProp : any + var n = F4.staticProp; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.errors.txt.diff deleted file mode 100644 index de38fe6769..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.jsContainerMergeJsContainer.errors.txt -+++ new.jsContainerMergeJsContainer.errors.txt -@@= skipped -0, +0 lines =@@ -- -+a.js(2,3): error TS2339: Property 'd' does not exist on type '{}'. -+b.js(1,3): error TS2339: Property 'd' does not exist on type '{}'. -+ -+ -+==== a.js (1 errors) ==== -+ const a = {}; -+ a.d = function() {}; -+ ~ -+!!! error TS2339: Property 'd' does not exist on type '{}'. -+==== b.js (1 errors) ==== -+ a.d.prototype = {}; -+ ~ -+!!! error TS2339: Property 'd' does not exist on type '{}'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.types.diff index ff7c30ef76..10be376c2f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeJsContainer.types.diff @@ -5,8 +5,9 @@ === a.js === const a = {}; ->a : typeof a -+>a : {} - >{} : {} +->{} : {} ++>a : { d: () => void; } ++>{} : { d: () => void; } a.d = function() {}; ->a.d = function() {} : typeof d @@ -15,9 +16,9 @@ ->d : typeof d ->function() {} : typeof d +>a.d = function() {} : () => void -+>a.d : any -+>a : {} -+>d : any ++>a.d : () => void ++>a : { d: () => void; } ++>d : () => void +>function() {} : () => void === b.js === @@ -29,8 +30,8 @@ ->d : typeof d ->prototype : {} +>a.d.prototype : any -+>a.d : any -+>a : {} -+>d : any ++>a.d : () => void ++>a : { d: () => void; } ++>d : () => void +>prototype : any >{} : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.errors.txt.diff index e200ada4a2..60d471196f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.errors.txt.diff @@ -2,21 +2,18 @@ +++ new.jsContainerMergeTsDeclaration.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(3,3): error TS2339: Property 'a' does not exist on type '() => void'. -+b.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '() => void', but here has type 'number'. ++b.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ (): void; a: () => void; }', but here has type 'number'. + + -+==== a.js (1 errors) ==== ++==== a.js (0 errors) ==== + var /*1*/x = function foo() { + } + x.a = function bar() { -+ ~ -+!!! error TS2339: Property 'a' does not exist on type '() => void'. + } +==== b.ts (1 errors) ==== + var x = function () { + ~ -+!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '() => void', but here has type 'number'. ++!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ (): void; a: () => void; }', but here has type 'number'. +!!! related TS6203 a.js:1:10: 'x' was also declared here. + return 1; + }(); diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.types.diff index 1f6927f650..b1659a444d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration.types.diff @@ -7,24 +7,22 @@ ->x : { (): void; a(): void; } ->function foo() {} : { (): void; a(): void; } ->foo : { (): void; a(): void; } -+>x : () => void -+>function foo() {} : () => void -+>foo : () => void ++>x : { (): void; a: () => void; } ++>function foo() {} : { (): void; a: () => void; } ++>foo : { (): void; a: () => void; } } x.a = function bar() { >x.a = function bar() {} : () => void -->x.a : () => void + >x.a : () => void ->x : { (): void; a(): void; } -->a : () => void -+>x.a : any -+>x : () => void -+>a : any ++>x : { (): void; a: () => void; } + >a : () => void >function bar() {} : () => void >bar : () => void } === b.ts === var x = function () { ->x : { (): void; a(): void; } -+>x : () => void ++>x : { (): void; a: () => void; } >function () { return 1;}() : number >function () { return 1;} : () => number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration3.types.diff index 69fb01713a..593a9f2aff 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsContainerMergeTsDeclaration3.types.diff @@ -5,8 +5,9 @@ === b.js === const A = { }; ->A : typeof A -+>A : {} - >{ } : {} +->{ } : {} ++>A : { d: {}; } ++>{ } : { d: {}; } A.d = { }; >A.d = { } : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.errors.txt.diff index 7f7511446a..47035117e1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.errors.txt.diff @@ -11,12 +11,11 @@ +jsDeclarationsClassMethod.js(51,14): error TS2551: Property 'method2' does not exist on type 'C2'. Did you mean 'method1'? +jsDeclarationsClassMethod.js(51,34): error TS7006: Parameter 'x' implicitly has an 'any' type. +jsDeclarationsClassMethod.js(51,37): error TS7006: Parameter 'y' implicitly has an 'any' type. -+jsDeclarationsClassMethod.js(61,4): error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. +jsDeclarationsClassMethod.js(61,27): error TS7006: Parameter 'x' implicitly has an 'any' type. +jsDeclarationsClassMethod.js(61,30): error TS7006: Parameter 'y' implicitly has an 'any' type. + + -+==== jsDeclarationsClassMethod.js (12 errors) ==== ++==== jsDeclarationsClassMethod.js (11 errors) ==== + function C1() { + /** + * A comment prop @@ -97,8 +96,6 @@ + * @returns {number} + */ + C2.staticProp = function (x, y) { -+ ~~~~~~~~~~ -+!!! error TS2339: Property 'staticProp' does not exist on type 'typeof C2'. + ~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. + ~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.types.diff index d02602f2dd..49ac0190d4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassMethod.types.diff @@ -131,13 +131,13 @@ ->C2.staticProp = function (x, y) { return x + y;} : (x: number, y: number) => number ->C2.staticProp : (x: number, y: number) => number +>C2.staticProp = function (x, y) { return x + y;} : (x: any, y: any) => any -+>C2.staticProp : any ++>C2.staticProp : (x: any, y: any) => any >C2 : typeof C2 ->staticProp : (x: number, y: number) => number ->function (x, y) { return x + y;} : (x: number, y: number) => number ->x : number ->y : number -+>staticProp : any ++>staticProp : (x: any, y: any) => any +>function (x, y) { return x + y;} : (x: any, y: any) => any +>x : any +>y : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff index a0fcde1937..ce30c8bd44 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff @@ -2,12 +2,11 @@ +++ new.jsDeclarationsClassStatic.errors.txt @@= skipped -0, +0 lines =@@ - -+source.js(9,9): error TS2339: Property 'statische' does not exist on type 'typeof Handler'. +source.js(15,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +source.js(16,16): error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. + + -+==== source.js (3 errors) ==== ++==== source.js (2 errors) ==== + class Handler { + static get OPTIONS() { + return 1; @@ -17,8 +16,6 @@ + } + } + Handler.statische = function() { } -+ ~~~~~~~~~ -+!!! error TS2339: Property 'statische' does not exist on type 'typeof Handler'. + const Strings = { + a: "A", + b: "B" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff index ea40c719df..2366108956 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff @@ -1,18 +1,6 @@ --- old.jsDeclarationsClassStatic.types +++ new.jsDeclarationsClassStatic.types -@@= skipped -16, +16 lines =@@ - } - Handler.statische = function() { } - >Handler.statische = function() { } : () => void -->Handler.statische : () => void -+>Handler.statische : any - >Handler : typeof Handler -->statische : () => void -+>statische : any - >function() { } : () => void - - const Strings = { -@@= skipped -21, +21 lines =@@ +@@= skipped -37, +37 lines =@@ module.exports = Handler; >module.exports = Handler : typeof Handler >module.exports : typeof Handler diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.errors.txt.diff index bcd8506c1b..59ee8f427b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.errors.txt.diff @@ -2,8 +2,6 @@ +++ new.jsObjectsMarkedAsOpenEnded.errors.txt @@= skipped -0, +0 lines =@@ - -+b.ts(1,10): error TS2339: Property 'a' does not exist on type '{}'. -+b.ts(2,18): error TS2339: Property 'a' does not exist on type '{}'. +b.ts(3,29): error TS2339: Property 'a' does not exist on type '{}'. +b.ts(4,14): error TS2339: Property 'a' does not exist on type '{}'. +b.ts(5,8): error TS2339: Property 'a' does not exist on type '{}'. @@ -35,13 +33,9 @@ + } + + -+==== b.ts (6 errors) ==== ++==== b.ts (4 errors) ==== + variable.a = 1; -+ ~ -+!!! error TS2339: Property 'a' does not exist on type '{}'. + (new C()).member.a = 1; -+ ~ -+!!! error TS2339: Property 'a' does not exist on type '{}'. + (new C()).initializedMember.a = 1; + ~ +!!! error TS2339: Property 'a' does not exist on type '{}'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.types.diff index 52a449209a..415302d693 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsObjectsMarkedAsOpenEnded.types.diff @@ -5,39 +5,47 @@ === a.js === var variable = {}; ->variable : typeof variable -+>variable : {} - >{} : {} +->{} : {} ++>variable : { a: number; } ++>{} : { a: number; } variable.a = 0; >variable.a = 0 : 0 -->variable.a : number + >variable.a : number ->variable : typeof variable -->a : number -+>variable.a : any -+>variable : {} -+>a : any ++>variable : { a: number; } + >a : number >0 : 0 - class C { -@@= skipped -20, +20 lines =@@ +@@= skipped -19, +19 lines =@@ + constructor() { this.member = {}; - >this.member = {} : {} +->this.member = {} : {} ->this.member : any -+>this.member : {} ++>this.member = {} : { a: number; } ++>this.member : { a: number; } >this : this ->member : any -+>member : {} - >{} : {} +->{} : {} ++>member : { a: number; } ++>{} : { a: number; } this.member.a = 0; >this.member.a = 0 : 0 ->this.member.a : error -+>this.member.a : any - >this.member : {} +->this.member : {} ++>this.member.a : number ++>this.member : { a: number; } >this : this - >member : {} -@@= skipped -28, +28 lines =@@ +->member : {} +->a : any ++>member : { a: number; } ++>a : number + >0 : 0 + } + } +@@= skipped -29, +29 lines =@@ obj.property.a = 0; >obj.property.a = 0 : 0 @@ -46,16 +54,28 @@ >obj.property : {} >obj : { property: {}; } >property : {} -@@= skipped -23, +23 lines =@@ - === b.ts === +@@= skipped -24, +24 lines =@@ variable.a = 1; >variable.a = 1 : 1 -->variable.a : number + >variable.a : number ->variable : typeof variable -->a : number -+>variable.a : any -+>variable : {} -+>a : any ++>variable : { a: number; } + >a : number + >1 : 1 + + (new C()).member.a = 1; + >(new C()).member.a = 1 : 1 +->(new C()).member.a : any +->(new C()).member : {} ++>(new C()).member.a : number ++>(new C()).member : { a: number; } + >(new C()) : C + >new C() : C + >C : typeof C +->member : {} +->a : any ++>member : { a: number; } ++>a : number >1 : 1 - (new C()).member.a = 1; \ No newline at end of file + (new C()).initializedMember.a = 1; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.errors.txt.diff index 38e40ed60b..0873599bac 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.errors.txt.diff @@ -6,44 +6,67 @@ - Type 'string' is not assignable to type 'number'. -/a.js(17,7): error TS2720: Class 'B3' incorrectly implements class 'A'. Did you mean to extend 'A' and inherit its members as a subclass? - Property 'method' is missing in type 'B3' but required in type 'A'. -+/a.js(23,4): error TS2339: Property 'C1' does not exist on type '{}'. -+/a.js(47,4): error TS2339: Property 'C5' does not exist on type '{}'. - - - ==== /a.js (2 errors) ==== -@@= skipped -18, +15 lines =@@ - class B2 { - /** @return {string} */ - method() { return "" } +- +- +-==== /a.js (2 errors) ==== +- class A { +- /** @return {number} */ +- method() { throw new Error(); } +- } +- /** @implements {A} */ +- class B { +- method() { return 0 } +- } +- +- /** @implements A */ +- class B2 { +- /** @return {string} */ +- method() { return "" } - ~~~~~~ -!!! error TS2416: Property 'method' in type 'B2' is not assignable to the same property in base type 'A'. -!!! error TS2416: Type '() => string' is not assignable to type '() => number'. -!!! error TS2416: Type 'string' is not assignable to type 'number'. - } - - /** @implements {A} */ - class B3 { +- } +- +- /** @implements {A} */ +- class B3 { - ~~ -!!! error TS2720: Class 'B3' incorrectly implements class 'A'. Did you mean to extend 'A' and inherit its members as a subclass? -!!! error TS2720: Property 'method' is missing in type 'B3' but required in type 'A'. -!!! related TS2728 /a.js:3:5: 'method' is declared here. - } - - - var Ns = {}; - /** @implements {A} */ - Ns.C1 = class { -+ ~~ -+!!! error TS2339: Property 'C1' does not exist on type '{}'. - method() { return 11; } - } - /** @implements {A} */ -@@= skipped -42, +36 lines =@@ - var C5; - /** @implements {A} */ - Ns.C5 = C5 || class { -+ ~~ -+!!! error TS2339: Property 'C5' does not exist on type '{}'. - method() { - return 15; - } \ No newline at end of file +- } +- +- +- var Ns = {}; +- /** @implements {A} */ +- Ns.C1 = class { +- method() { return 11; } +- } +- /** @implements {A} */ +- var C2 = class { +- method() { return 12; } +- } +- var o = { +- /** @implements {A} */ +- C3: class { +- method() { return 13; } +- } +- } +- class CC { +- /** @implements {A} */ +- C4 = class { +- method() { +- return 14; +- } +- } +- } +- +- var C5; +- /** @implements {A} */ +- Ns.C5 = C5 || class { +- method() { +- return 15; +- } +- } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.types.diff index 2988361747..ac71634c68 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImplements_class.types.diff @@ -5,21 +5,19 @@ var Ns = {}; ->Ns : typeof Ns -+>Ns : {} - >{} : {} +->{} : {} ++>Ns : { C1: typeof C1; C5: any; } ++>{} : { C1: typeof C1; C5: any; } /** @implements {A} */ Ns.C1 = class { >Ns.C1 = class { method() { return 11; }} : typeof C1 -->Ns.C1 : typeof C1 + >Ns.C1 : typeof C1 ->Ns : typeof Ns -->C1 : typeof C1 -+>Ns.C1 : any -+>Ns : {} -+>C1 : any ++>Ns : { C1: typeof C1; C5: any; } + >C1 : typeof C1 >class { method() { return 11; }} : typeof C1 - method() { return 11; } @@= skipped -60, +60 lines =@@ /** @implements {A} */ @@ -32,7 +30,7 @@ ->C5 : undefined +>Ns.C5 = C5 || class { method() { return 15; }} : any +>Ns.C5 : any -+>Ns : {} ++>Ns : { C1: typeof C1; C5: any; } +>C5 : any +>C5 || class { method() { return 15; }} : any +>C5 : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.errors.txt.diff index 6a7de887d0..df5871c93a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.errors.txt.diff @@ -8,15 +8,13 @@ +a.js(27,16): error TS2315: Type 'Object' is not generic. +a.js(28,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(35,37): error TS7006: Parameter 'key' implicitly has an 'any' type. -+a.js(46,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. +a.js(47,16): error TS2315: Type 'Object' is not generic. +a.js(47,31): error TS2304: Cannot find name 'V'. -+a.js(48,10): error TS2339: Property '_map' does not exist on type '{}'. -+a.js(55,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. ++a.js(48,10): error TS2339: Property '_map' does not exist on type '{ Multimap3: () => void; }'. +a.js(55,40): error TS7006: Parameter 'key' implicitly has an 'any' type. + + -+==== a.js (12 errors) ==== ++==== a.js (10 errors) ==== + /** + * Should work for function declarations + * @constructor @@ -75,8 +73,6 @@ + * @template V + */ + Ns.Multimap3 = function() { -+ ~~~~~~~~~ -+!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. + /** @type {Object} TODO: Remove the prototype from the fresh object */ + ~~~~~~~~~~~~~~~~~ +!!! error TS2315: Type 'Object' is not generic. @@ -84,7 +80,7 @@ +!!! error TS2304: Cannot find name 'V'. + this._map = {}; + ~~~~ -+!!! error TS2339: Property '_map' does not exist on type '{}'. ++!!! error TS2339: Property '_map' does not exist on type '{ Multimap3: () => void; }'. + }; + + /** @@ -92,8 +88,6 @@ + * @returns {V} the value ok + */ + Ns.Multimap3.prototype.get = function (key) { -+ ~~~~~~~~~ -+!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. + ~~~ +!!! error TS7006: Parameter 'key' implicitly has an 'any' type. + return this._map[key + '']; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.types.diff index 6eef0b3a48..677a79a541 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag4.types.diff @@ -110,10 +110,12 @@ var Ns = {}; ->Ns : typeof Ns -+>Ns : {} - >{} : {} +->{} : {} ++>Ns : { Multimap3: () => void; } ++>{} : { Multimap3: () => void; } /** + * Should work for expando-namespaced initialisers too @@= skipped -30, +30 lines =@@ * @template V */ @@ -124,9 +126,9 @@ ->Multimap3 : typeof Multimap3 ->function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : typeof Multimap3 +>Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void -+>Ns.Multimap3 : any -+>Ns : {} -+>Multimap3 : any ++>Ns.Multimap3 : () => void ++>Ns : { Multimap3: () => void; } ++>Multimap3 : () => void +>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void /** @type {Object} TODO: Remove the prototype from the fresh object */ @@ -137,7 +139,7 @@ ->_map : { [x: string]: V; } +>this._map = {} : any +>this._map : any -+>this : {} ++>this : { Multimap3: () => void; } +>_map : any +>{} : any >{} : {} @@ -154,9 +156,9 @@ ->Ns.Multimap3 : typeof Multimap3 ->Ns : typeof Ns ->Multimap3 : typeof Multimap3 -+>Ns.Multimap3 : any -+>Ns : {} -+>Multimap3 : any ++>Ns.Multimap3 : () => void ++>Ns : { Multimap3: () => void; } ++>Multimap3 : () => void >prototype : any >get : any ->function (key) { return this._map[key + ''];} : (key: K) => V diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.errors.txt.diff index cabb8620c5..07b92f7b87 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.errors.txt.diff @@ -11,13 +11,13 @@ +a.js(30,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(35,16): error TS2304: Cannot find name 'K'. +a.js(36,18): error TS2304: Cannot find name 'V'. -+a.js(50,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. ++a.js(39,21): error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'. +a.js(51,16): error TS2315: Type 'Object' is not generic. +a.js(51,31): error TS2304: Cannot find name 'V'. -+a.js(52,10): error TS2339: Property '_map' does not exist on type '{}'. -+a.js(55,4): error TS2339: Property 'Multimap3' does not exist on type '{}'. ++a.js(52,10): error TS2339: Property '_map' does not exist on type '{ Multimap3: { (): void; prototype: { get(key: K): V; }; }; }'. +a.js(57,16): error TS2304: Cannot find name 'K'. +a.js(58,18): error TS2304: Cannot find name 'V'. ++a.js(61,21): error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'. + + +==== a.js (16 errors) ==== @@ -78,6 +78,8 @@ + */ + get: function(key) { + return this._map[key + '']; ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'. + } + } + @@ -89,8 +91,6 @@ + * @template V + */ + Ns.Multimap3 = function() { -+ ~~~~~~~~~ -+!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. + /** @type {Object} TODO: Remove the prototype from the fresh object */ + ~~~~~~~~~~~~~~~~~ +!!! error TS2315: Type 'Object' is not generic. @@ -98,12 +98,10 @@ +!!! error TS2304: Cannot find name 'V'. + this._map = {}; + ~~~~ -+!!! error TS2339: Property '_map' does not exist on type '{}'. ++!!! error TS2339: Property '_map' does not exist on type '{ Multimap3: { (): void; prototype: { get(key: K): V; }; }; }'. + }; + + Ns.Multimap3.prototype = { -+ ~~~~~~~~~ -+!!! error TS2339: Property 'Multimap3' does not exist on type '{}'. + /** + * @param {K} key the key ok + ~ @@ -114,6 +112,8 @@ + */ + get(key) { + return this._map[key + '']; ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'. + } + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.types.diff index 7101b8188d..b48103de95 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTemplateTag5.types.diff @@ -51,8 +51,8 @@ var Multimap2 = function() { ->Multimap2 : typeof Multimap2 ->function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : typeof Multimap2 -+>Multimap2 : () => void -+>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void ++>Multimap2 : { (): void; prototype: { get: (key: K) => V; }; } ++>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get: (key: K) => V; }; } /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -68,19 +68,16 @@ >{} : {} }; - +@@= skipped -16, +17 lines =@@ Multimap2.prototype = { >Multimap2.prototype = { /** * @param {K} key the key ok * @returns {V} the value ok */ get: function(key) { return this._map[key + '']; }} : { get: (key: K) => V; } -->Multimap2.prototype : { get: (key: K) => V; } + >Multimap2.prototype : { get: (key: K) => V; } ->Multimap2 : typeof Multimap2 -->prototype : { get: (key: K) => V; } -+>Multimap2.prototype : any -+>Multimap2 : () => void -+>prototype : any ++>Multimap2 : { (): void; prototype: { get: (key: K) => V; }; } + >prototype : { get: (key: K) => V; } >{ /** * @param {K} key the key ok * @returns {V} the value ok */ get: function(key) { return this._map[key + '']; }} : { get: (key: K) => V; } - /** -@@= skipped -30, +31 lines =@@ +@@= skipped -14, +14 lines =@@ >key : K return this._map[key + '']; @@ -90,7 +87,7 @@ ->_map : { [x: string]: V; } +>this._map[key + ''] : any +>this._map : any -+>this : any ++>this : { get: (key: K) => V; } +>_map : any >key + '' : string >key : K @@ -100,10 +97,12 @@ var Ns = {}; ->Ns : typeof Ns -+>Ns : {} - >{} : {} +->{} : {} ++>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } ++>{} : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } /** + * Should work for expando-namespaced initialisers too @@= skipped -10, +10 lines =@@ * @template V */ @@ -113,11 +112,11 @@ ->Ns : typeof Ns ->Multimap3 : typeof Multimap3 ->function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : typeof Multimap3 -+>Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void -+>Ns.Multimap3 : any -+>Ns : {} -+>Multimap3 : any -+>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : () => void ++>Ns.Multimap3 = function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get(key: K): V; }; } ++>Ns.Multimap3 : { (): void; prototype: { get(key: K): V; }; } ++>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } ++>Multimap3 : { (): void; prototype: { get(key: K): V; }; } ++>function() { /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {};} : { (): void; prototype: { get(key: K): V; }; } /** @type {Object} TODO: Remove the prototype from the fresh object */ this._map = {}; @@ -127,29 +126,26 @@ ->_map : { [x: string]: V; } +>this._map = {} : any +>this._map : any -+>this : {} ++>this : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } +>_map : any +>{} : any >{} : {} }; - +@@= skipped -19, +20 lines =@@ Ns.Multimap3.prototype = { >Ns.Multimap3.prototype = { /** * @param {K} key the key ok * @returns {V} the value ok */ get(key) { return this._map[key + '']; }} : { get(key: K): V; } -->Ns.Multimap3.prototype : { get(key: K): V; } + >Ns.Multimap3.prototype : { get(key: K): V; } ->Ns.Multimap3 : typeof Multimap3 ->Ns : typeof Ns ->Multimap3 : typeof Multimap3 -->prototype : { get(key: K): V; } -+>Ns.Multimap3.prototype : any -+>Ns.Multimap3 : any -+>Ns : {} -+>Multimap3 : any -+>prototype : any ++>Ns.Multimap3 : { (): void; prototype: { get(key: K): V; }; } ++>Ns : { Multimap3: { (): void; prototype: { get(key: K): V; }; }; } ++>Multimap3 : { (): void; prototype: { get(key: K): V; }; } + >prototype : { get(key: K): V; } >{ /** * @param {K} key the key ok * @returns {V} the value ok */ get(key) { return this._map[key + '']; }} : { get(key: K): V; } - /** -@@= skipped -34, +35 lines =@@ +@@= skipped -15, +15 lines =@@ >key : K return this._map[key + '']; @@ -159,7 +155,7 @@ ->_map : { [x: string]: V; } +>this._map[key + ''] : any +>this._map : any -+>this : any ++>this : { get(key: K): V; } +>_map : any >key + '' : string >key : K diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.errors.txt.diff index 803050ee25..6d5f9a870c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.errors.txt.diff @@ -3,11 +3,9 @@ @@= skipped -0, +0 lines =@@ - +jsdocTypeReferenceToMergedClass.js(2,12): error TS2503: Cannot find namespace 'Workspace'. -+jsdocTypeReferenceToMergedClass.js(6,11): error TS2339: Property 'Project' does not exist on type '{}'. -+jsdocTypeReferenceToMergedClass.js(7,11): error TS2339: Property 'Project' does not exist on type '{}'. + + -+==== jsdocTypeReferenceToMergedClass.js (3 errors) ==== ++==== jsdocTypeReferenceToMergedClass.js (1 errors) ==== + var Workspace = {} + /** @type {Workspace.Project} */ + ~~~~~~~~~ @@ -16,11 +14,7 @@ + p.isServiceProject() + + Workspace.Project = function wp() { } -+ ~~~~~~~ -+!!! error TS2339: Property 'Project' does not exist on type '{}'. + Workspace.Project.prototype = { -+ ~~~~~~~ -+!!! error TS2339: Property 'Project' does not exist on type '{}'. + isServiceProject() {} + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.types.diff index 2b29eacc0b..a9cb9315dd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToMergedClass.types.diff @@ -5,8 +5,9 @@ === jsdocTypeReferenceToMergedClass.js === var Workspace = {} ->Workspace : typeof Workspace -+>Workspace : {} - >{} : {} +->{} : {} ++>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } ++>{} : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } /** @type {Workspace.Project} */ var p; @@ -30,25 +31,21 @@ ->Project : typeof wp ->function wp() { } : typeof wp ->wp : typeof wp -+>Workspace.Project = function wp() { } : () => void -+>Workspace.Project : any -+>Workspace : {} -+>Project : any -+>function wp() { } : () => void -+>wp : () => void ++>Workspace.Project = function wp() { } : { (): void; prototype: { isServiceProject(): void; }; } ++>Workspace.Project : { (): void; prototype: { isServiceProject(): void; }; } ++>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } ++>Project : { (): void; prototype: { isServiceProject(): void; }; } ++>function wp() { } : { (): void; prototype: { isServiceProject(): void; }; } ++>wp : { (): void; prototype: { isServiceProject(): void; }; } Workspace.Project.prototype = { >Workspace.Project.prototype = { isServiceProject() {}} : { isServiceProject(): void; } -->Workspace.Project.prototype : { isServiceProject(): void; } + >Workspace.Project.prototype : { isServiceProject(): void; } ->Workspace.Project : typeof wp ->Workspace : typeof Workspace ->Project : typeof wp -->prototype : { isServiceProject(): void; } -+>Workspace.Project.prototype : any -+>Workspace.Project : any -+>Workspace : {} -+>Project : any -+>prototype : any ++>Workspace.Project : { (): void; prototype: { isServiceProject(): void; }; } ++>Workspace : { Project: { (): void; prototype: { isServiceProject(): void; }; }; } ++>Project : { (): void; prototype: { isServiceProject(): void; }; } + >prototype : { isServiceProject(): void; } >{ isServiceProject() {}} : { isServiceProject(): void; } - - isServiceProject() {} \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/propertyAssignmentOnParenthesizedNumber.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/propertyAssignmentOnParenthesizedNumber.types.diff new file mode 100644 index 0000000000..3d6ba24206 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/propertyAssignmentOnParenthesizedNumber.types.diff @@ -0,0 +1,21 @@ +--- old.propertyAssignmentOnParenthesizedNumber.types ++++ new.propertyAssignmentOnParenthesizedNumber.types +@@= skipped -1, +1 lines =@@ + + === bug38934.js === + var x = {}; +->x : {} +->{} : {} ++>x : { 0: number; } ++>{} : { 0: number; } + + // should not crash and also should not result in a property '0' on x. + x[(0)] = 1; + >x[(0)] = 1 : 1 +->x[(0)] : any +->x : {} ++>x[(0)] : number ++>x : { 0: number; } + >(0) : 0 + >0 : 0 + >1 : 1 \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt.diff index 23d8601940..55aaf5a4fd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.errors.txt.diff @@ -3,36 +3,12 @@ @@= skipped -0, +0 lines =@@ -other.js(5,5): error TS2339: Property 'wat' does not exist on type 'One'. -other.js(10,5): error TS2339: Property 'wat' does not exist on type 'Two'. -- -- --==== prototypePropertyAssignmentMergeAcrossFiles2.js (0 errors) ==== +other.js(2,11): error TS2503: Cannot find namespace 'Ns'. +other.js(7,11): error TS2503: Cannot find namespace 'Ns'. -+prototypePropertyAssignmentMergeAcrossFiles2.js(2,4): error TS2339: Property 'One' does not exist on type '{}'. -+prototypePropertyAssignmentMergeAcrossFiles2.js(3,4): error TS2339: Property 'Two' does not exist on type '{}'. -+prototypePropertyAssignmentMergeAcrossFiles2.js(5,4): error TS2339: Property 'One' does not exist on type '{}'. -+prototypePropertyAssignmentMergeAcrossFiles2.js(8,4): error TS2339: Property 'Two' does not exist on type '{}'. -+ -+ -+==== prototypePropertyAssignmentMergeAcrossFiles2.js (4 errors) ==== - var Ns = {} - Ns.One = function() {}; -+ ~~~ -+!!! error TS2339: Property 'One' does not exist on type '{}'. - Ns.Two = function() {}; -+ ~~~ -+!!! error TS2339: Property 'Two' does not exist on type '{}'. - - Ns.One.prototype = { -+ ~~~ -+!!! error TS2339: Property 'One' does not exist on type '{}'. - ok() {}, - }; - Ns.Two.prototype = { -+ ~~~ -+!!! error TS2339: Property 'Two' does not exist on type '{}'. - } - + + + ==== prototypePropertyAssignmentMergeAcrossFiles2.js (0 errors) ==== +@@= skipped -15, +15 lines =@@ ==== other.js (2 errors) ==== /** * @type {Ns.One} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types.diff index 2f1761f241..1090cbb287 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/prototypePropertyAssignmentMergeAcrossFiles2.types.diff @@ -5,8 +5,9 @@ === prototypePropertyAssignmentMergeAcrossFiles2.js === var Ns = {} ->Ns : typeof Ns -+>Ns : {} - >{} : {} +->{} : {} ++>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } ++>{} : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } Ns.One = function() {}; ->Ns.One = function() {} : typeof One @@ -14,11 +15,11 @@ ->Ns : typeof Ns ->One : typeof One ->function() {} : typeof One -+>Ns.One = function() {} : () => void -+>Ns.One : any -+>Ns : {} -+>One : any -+>function() {} : () => void ++>Ns.One = function() {} : { (): void; prototype: { ok(): void; }; } ++>Ns.One : { (): void; prototype: { ok(): void; }; } ++>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } ++>One : { (): void; prototype: { ok(): void; }; } ++>function() {} : { (): void; prototype: { ok(): void; }; } Ns.Two = function() {}; ->Ns.Two = function() {} : typeof Two @@ -26,45 +27,38 @@ ->Ns : typeof Ns ->Two : typeof Two ->function() {} : typeof Two -+>Ns.Two = function() {} : () => void -+>Ns.Two : any -+>Ns : {} -+>Two : any -+>function() {} : () => void ++>Ns.Two = function() {} : { (): void; prototype: {}; } ++>Ns.Two : { (): void; prototype: {}; } ++>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } ++>Two : { (): void; prototype: {}; } ++>function() {} : { (): void; prototype: {}; } Ns.One.prototype = { >Ns.One.prototype = { ok() {},} : { ok(): void; } -->Ns.One.prototype : { ok(): void; } + >Ns.One.prototype : { ok(): void; } ->Ns.One : typeof One ->Ns : typeof Ns ->One : typeof One -->prototype : { ok(): void; } -+>Ns.One.prototype : any -+>Ns.One : any -+>Ns : {} -+>One : any -+>prototype : any ++>Ns.One : { (): void; prototype: { ok(): void; }; } ++>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } ++>One : { (): void; prototype: { ok(): void; }; } + >prototype : { ok(): void; } >{ ok() {},} : { ok(): void; } - ok() {}, -@@= skipped -32, +32 lines =@@ - }; +@@= skipped -33, +33 lines =@@ Ns.Two.prototype = { >Ns.Two.prototype = {} : {} -->Ns.Two.prototype : {} + >Ns.Two.prototype : {} ->Ns.Two : typeof Two ->Ns : typeof Ns ->Two : typeof Two -->prototype : {} -+>Ns.Two.prototype : any -+>Ns.Two : any -+>Ns : {} -+>Two : any -+>prototype : any ++>Ns.Two : { (): void; prototype: {}; } ++>Ns : { One: { (): void; prototype: { ok(): void; }; }; Two: { (): void; prototype: {}; }; } ++>Two : { (): void; prototype: {}; } + >prototype : {} >{} : {} } - -@@= skipped -13, +13 lines =@@ +@@= skipped -12, +12 lines =@@ * @type {Ns.One} */ var one; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.errors.txt.diff index 0a05482123..46f52a51ad 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.errors.txt.diff @@ -2,18 +2,15 @@ +++ new.typeFromPropertyAssignment.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(4,7): error TS2339: Property 'Inner' does not exist on type 'typeof O'. +a.js(8,12): error TS2749: 'Outer' refers to a value, but is being used as a type here. Did you mean 'typeof Outer'? +a.js(11,12): error TS2503: Cannot find namespace 'Outer'. + + -+==== a.js (3 errors) ==== ++==== a.js (2 errors) ==== + var Outer = class O { + m(x, y) { } + } + Outer.Inner = class I { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type 'typeof O'. + n(a, b) { } + + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.types.diff index 653cc2c27c..44c1fbc240 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment.types.diff @@ -1,18 +1,6 @@ --- old.typeFromPropertyAssignment.types +++ new.typeFromPropertyAssignment.types -@@= skipped -12, +12 lines =@@ - } - Outer.Inner = class I { - >Outer.Inner = class I { n(a, b) { }} : typeof I -->Outer.Inner : typeof I -+>Outer.Inner : any - >Outer : typeof O -->Inner : typeof I -+>Inner : any - >class I { n(a, b) { }} : typeof I - >I : typeof I - -@@= skipped -14, +14 lines =@@ +@@= skipped -26, +26 lines =@@ } /** @type {Outer} */ var si diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.errors.txt.diff new file mode 100644 index 0000000000..98eab4d8a6 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.errors.txt.diff @@ -0,0 +1,28 @@ +--- old.typeFromPropertyAssignment11.errors.txt ++++ new.typeFromPropertyAssignment11.errors.txt +@@= skipped -0, +0 lines =@@ +- ++module.js(7,17): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. ++module.js(9,17): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. ++ ++ ++==== module.js (2 errors) ==== ++ var Inner = function() {} ++ Inner.prototype = { ++ m() { }, ++ i: 1 ++ } ++ // incremental assignments still work ++ Inner.prototype.j = 2 ++ ~ ++!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. ++ /** @type {string} */ ++ Inner.prototype.k; ++ ~ ++!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. ++ var inner = new Inner() ++ inner.m() ++ inner.i ++ inner.j ++ inner.k ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.types.diff index 91e61733e0..64f4aa915d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment11.types.diff @@ -6,42 +6,33 @@ var Inner = function() {} ->Inner : typeof Inner ->function() {} : typeof Inner -+>Inner : () => void -+>function() {} : () => void ++>Inner : { (): void; prototype: { m(): void; i: number; }; } ++>function() {} : { (): void; prototype: { m(): void; i: number; }; } Inner.prototype = { >Inner.prototype = { m() { }, i: 1} : { m(): void; i: number; } -->Inner.prototype : { m(): void; i: number; } + >Inner.prototype : { m(): void; i: number; } ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Inner.prototype : any -+>Inner : () => void -+>prototype : any ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >{ m() { }, i: 1} : { m(): void; i: number; } - m() { }, -@@= skipped -21, +21 lines =@@ - Inner.prototype.j = 2 +@@= skipped -22, +22 lines =@@ >Inner.prototype.j = 2 : 2 >Inner.prototype.j : any -->Inner.prototype : { m(): void; i: number; } + >Inner.prototype : { m(): void; i: number; } ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Inner.prototype : any -+>Inner : () => void -+>prototype : any ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >j : any >2 : 2 - - /** @type {string} */ +@@= skipped -9, +9 lines =@@ Inner.prototype.k; >Inner.prototype.k : any -->Inner.prototype : { m(): void; i: number; } + >Inner.prototype : { m(): void; i: number; } ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Inner.prototype : any -+>Inner : () => void -+>prototype : any ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >k : any var inner = new Inner() @@ -50,7 +41,7 @@ ->Inner : typeof Inner +>inner : any +>new Inner() : any -+>Inner : () => void ++>Inner : { (): void; prototype: { m(): void; i: number; }; } inner.m() ->inner.m() : void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.errors.txt.diff index bb55e5d73b..f820631829 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.errors.txt.diff @@ -2,35 +2,26 @@ +++ new.typeFromPropertyAssignment13.errors.txt @@= skipped -0, +0 lines =@@ - -+module.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+module.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+module.js(8,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+module.js(10,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+module.js(11,23): error TS2339: Property 'Inner' does not exist on type '{}'. ++module.js(8,23): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. ++module.js(10,23): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. + + -+==== module.js (5 errors) ==== ++==== module.js (2 errors) ==== + var Outer = {} + Outer.Inner = function() {} -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + Outer.Inner.prototype = { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + m() { }, + i: 1 + } + // incremental assignments still work + Outer.Inner.prototype.j = 2 -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. ++ ~ ++!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'. + /** @type {string} */ + Outer.Inner.prototype.k; -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. ++ ~ ++!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'. + var inner = new Outer.Inner() -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + inner.m() + inner.i + inner.j diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.types.diff index 098a0d373c..a160623ba6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment13.types.diff @@ -5,8 +5,9 @@ === module.js === var Outer = {} ->Outer : typeof Outer -+>Outer : {} - >{} : {} +->{} : {} ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>{} : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } Outer.Inner = function() {} ->Outer.Inner = function() {} : typeof Inner @@ -14,57 +15,48 @@ ->Outer : typeof Outer ->Inner : typeof Inner ->function() {} : typeof Inner -+>Outer.Inner = function() {} : () => void -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>function() {} : () => void ++>Outer.Inner = function() {} : { (): void; prototype: { m(): void; i: number; }; } ++>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>Inner : { (): void; prototype: { m(): void; i: number; }; } ++>function() {} : { (): void; prototype: { m(): void; i: number; }; } Outer.Inner.prototype = { >Outer.Inner.prototype = { m() { }, i: 1} : { m(): void; i: number; } -->Outer.Inner.prototype : { m(): void; i: number; } + >Outer.Inner.prototype : { m(): void; i: number; } ->Outer.Inner : typeof Inner ->Outer : typeof Outer ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Outer.Inner.prototype : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>prototype : any ++>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >{ m() { }, i: 1} : { m(): void; i: number; } - m() { }, -@@= skipped -30, +30 lines =@@ - Outer.Inner.prototype.j = 2 +@@= skipped -31, +31 lines =@@ >Outer.Inner.prototype.j = 2 : 2 >Outer.Inner.prototype.j : any -->Outer.Inner.prototype : { m(): void; i: number; } + >Outer.Inner.prototype : { m(): void; i: number; } ->Outer.Inner : typeof Inner ->Outer : typeof Outer ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Outer.Inner.prototype : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>prototype : any ++>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >j : any >2 : 2 - - /** @type {string} */ +@@= skipped -11, +11 lines =@@ Outer.Inner.prototype.k; >Outer.Inner.prototype.k : any -->Outer.Inner.prototype : { m(): void; i: number; } + >Outer.Inner.prototype : { m(): void; i: number; } ->Outer.Inner : typeof Inner ->Outer : typeof Outer ->Inner : typeof Inner -->prototype : { m(): void; i: number; } -+>Outer.Inner.prototype : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>prototype : any ++>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>Inner : { (): void; prototype: { m(): void; i: number; }; } + >prototype : { m(): void; i: number; } >k : any var inner = new Outer.Inner() @@ -75,9 +67,9 @@ ->Inner : typeof Inner +>inner : any +>new Outer.Inner() : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer.Inner : { (): void; prototype: { m(): void; i: number; }; } ++>Outer : { Inner: { (): void; prototype: { m(): void; i: number; }; }; } ++>Inner : { (): void; prototype: { m(): void; i: number; }; } inner.m() ->inner.m() : void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.errors.txt.diff index b3caecf74d..99d17f1f61 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.errors.txt.diff @@ -2,17 +2,13 @@ +++ new.typeFromPropertyAssignment15.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. +a.js(10,12): error TS2503: Cannot find namespace 'Outer'. -+a.js(14,22): error TS2339: Property 'Inner' does not exist on type '{}'. + + -+==== a.js (3 errors) ==== ++==== a.js (1 errors) ==== + var Outer = {}; + + Outer.Inner = class { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + constructor() { + this.x = 1 + } @@ -26,8 +22,6 @@ + inner.x + inner.m() + var inno = new Outer.Inner() -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + inno.x + inno.m() + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.types.diff index 19a6be28a0..454f85050b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment15.types.diff @@ -5,17 +5,16 @@ === a.js === var Outer = {}; ->Outer : typeof Outer -+>Outer : {} - >{} : {} +->{} : {} ++>Outer : { Inner: typeof Inner; } ++>{} : { Inner: typeof Inner; } Outer.Inner = class { >Outer.Inner = class { constructor() { this.x = 1 } m() { }} : typeof Inner -->Outer.Inner : typeof Inner + >Outer.Inner : typeof Inner ->Outer : typeof Outer -->Inner : typeof Inner -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer : { Inner: typeof Inner; } + >Inner : typeof Inner >class { constructor() { this.x = 1 } m() { }} : typeof Inner constructor() { @@ -55,31 +54,11 @@ +>m : any var inno = new Outer.Inner() -->inno : Inner -->new Outer.Inner() : Inner -->Outer.Inner : typeof Inner + >inno : Inner + >new Outer.Inner() : Inner + >Outer.Inner : typeof Inner ->Outer : typeof Outer -->Inner : typeof Inner -+>inno : any -+>new Outer.Inner() : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer : { Inner: typeof Inner; } + >Inner : typeof Inner - inno.x -->inno.x : number -->inno : Inner -->x : number -+>inno.x : any -+>inno : any -+>x : any - - inno.m() -->inno.m() : void -->inno.m : () => void -->inno : Inner -->m : () => void -+>inno.m() : any -+>inno.m : any -+>inno : any -+>m : any + inno.x \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.errors.txt.diff index 900365bc66..eaa4b7ab57 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.errors.txt.diff @@ -2,21 +2,14 @@ +++ new.typeFromPropertyAssignment16.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(3,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+a.js(4,7): error TS2339: Property 'Inner' does not exist on type '{}'. +a.js(9,12): error TS2503: Cannot find namespace 'Outer'. -+a.js(13,22): error TS2339: Property 'Inner' does not exist on type '{}'. + + -+==== a.js (4 errors) ==== ++==== a.js (1 errors) ==== + var Outer = {}; + + Outer.Inner = function () {} -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + Outer.Inner.prototype = { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + x: 1, + m() { } + } @@ -28,8 +21,6 @@ + inner.x + inner.m() + var inno = new Outer.Inner() -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + inno.x + inno.m() + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.types.diff index 36bac4c08a..176371c411 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment16.types.diff @@ -5,8 +5,9 @@ === a.js === var Outer = {}; ->Outer : typeof Outer -+>Outer : {} - >{} : {} +->{} : {} ++>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } ++>{} : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } Outer.Inner = function () {} ->Outer.Inner = function () {} : typeof Inner @@ -14,27 +15,24 @@ ->Outer : typeof Outer ->Inner : typeof Inner ->function () {} : typeof Inner -+>Outer.Inner = function () {} : () => void -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>function () {} : () => void ++>Outer.Inner = function () {} : { (): void; prototype: { x: number; m(): void; }; } ++>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } ++>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } ++>Inner : { (): void; prototype: { x: number; m(): void; }; } ++>function () {} : { (): void; prototype: { x: number; m(): void; }; } Outer.Inner.prototype = { >Outer.Inner.prototype = { x: 1, m() { }} : { x: number; m(): void; } -->Outer.Inner.prototype : { x: number; m(): void; } + >Outer.Inner.prototype : { x: number; m(): void; } ->Outer.Inner : typeof Inner ->Outer : typeof Outer ->Inner : typeof Inner -->prototype : { x: number; m(): void; } -+>Outer.Inner.prototype : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any -+>prototype : any ++>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } ++>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } ++>Inner : { (): void; prototype: { x: number; m(): void; }; } + >prototype : { x: number; m(): void; } >{ x: 1, m() { }} : { x: number; m(): void; } - x: 1, @@= skipped -29, +29 lines =@@ /** @type {Outer.Inner} */ @@ -68,9 +66,9 @@ ->Inner : typeof Inner +>inno : any +>new Outer.Inner() : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer.Inner : { (): void; prototype: { x: number; m(): void; }; } ++>Outer : { Inner: { (): void; prototype: { x: number; m(): void; }; }; } ++>Inner : { (): void; prototype: { x: number; m(): void; }; } inno.x ->inno.x : number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.errors.txt.diff index 16a3367acc..c31d604472 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.errors.txt.diff @@ -2,35 +2,26 @@ +++ new.typeFromPropertyAssignment18.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(4,10): error TS2339: Property 'p' does not exist on type '{}'. -+a.js(5,12): error TS2339: Property 'q' does not exist on type '{}'. -+a.js(7,10): error TS2339: Property 'p' does not exist on type '{}'. -+a.js(8,10): error TS2339: Property 'q' does not exist on type '{}'. -+a.js(9,12): error TS2339: Property 'p' does not exist on type '{}'. -+a.js(10,12): error TS2339: Property 'q' does not exist on type '{}'. ++a.js(4,10): error TS2339: Property 'p' does not exist on type '{ q: number; }'. ++a.js(7,10): error TS2339: Property 'p' does not exist on type '{ q: number; }'. ++a.js(9,12): error TS2339: Property 'p' does not exist on type '{ q: number; }'. + + -+==== a.js (6 errors) ==== ++==== a.js (3 errors) ==== + var GLOBSTAR = m.GLOBSTAR = {} + function m() { + } + GLOBSTAR.p = 1 + ~ -+!!! error TS2339: Property 'p' does not exist on type '{}'. ++!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. + m.GLOBSTAR.q = 2 -+ ~ -+!!! error TS2339: Property 'q' does not exist on type '{}'. + + GLOBSTAR.p + ~ -+!!! error TS2339: Property 'p' does not exist on type '{}'. ++!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. + GLOBSTAR.q -+ ~ -+!!! error TS2339: Property 'q' does not exist on type '{}'. + m.GLOBSTAR.p + ~ -+!!! error TS2339: Property 'p' does not exist on type '{}'. ++!!! error TS2339: Property 'p' does not exist on type '{ q: number; }'. + m.GLOBSTAR.q -+ ~ -+!!! error TS2339: Property 'q' does not exist on type '{}'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.types.diff index 0302df3c18..e300c8211a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment18.types.diff @@ -9,16 +9,17 @@ ->m.GLOBSTAR : typeof m.GLOBSTAR ->m : typeof m ->GLOBSTAR : typeof m.GLOBSTAR -+>GLOBSTAR : {} -+>m.GLOBSTAR = {} : {} -+>m.GLOBSTAR : {} -+>m : { (): void; GLOBSTAR: {}; } -+>GLOBSTAR : {} - >{} : {} +->{} : {} ++>GLOBSTAR : { q: number; } ++>m.GLOBSTAR = {} : { q: number; } ++>m.GLOBSTAR : { q: number; } ++>m : { (): void; GLOBSTAR: { q: number; }; } ++>GLOBSTAR : { q: number; } ++>{} : { q: number; } function m() { ->m : typeof m -+>m : { (): void; GLOBSTAR: {}; } ++>m : { (): void; GLOBSTAR: { q: number; }; } } GLOBSTAR.p = 1 >GLOBSTAR.p = 1 : 1 @@ -26,22 +27,20 @@ ->GLOBSTAR : typeof m.GLOBSTAR ->p : number +>GLOBSTAR.p : any -+>GLOBSTAR : {} ++>GLOBSTAR : { q: number; } +>p : any >1 : 1 m.GLOBSTAR.q = 2 >m.GLOBSTAR.q = 2 : 2 -->m.GLOBSTAR.q : number + >m.GLOBSTAR.q : number ->m.GLOBSTAR : typeof m.GLOBSTAR ->m : typeof m ->GLOBSTAR : typeof m.GLOBSTAR -->q : number -+>m.GLOBSTAR.q : any -+>m.GLOBSTAR : {} -+>m : { (): void; GLOBSTAR: {}; } -+>GLOBSTAR : {} -+>q : any ++>m.GLOBSTAR : { q: number; } ++>m : { (): void; GLOBSTAR: { q: number; }; } ++>GLOBSTAR : { q: number; } + >q : number >2 : 2 GLOBSTAR.p @@ -49,16 +48,14 @@ ->GLOBSTAR : typeof m.GLOBSTAR ->p : number +>GLOBSTAR.p : any -+>GLOBSTAR : {} ++>GLOBSTAR : { q: number; } +>p : any GLOBSTAR.q -->GLOBSTAR.q : number + >GLOBSTAR.q : number ->GLOBSTAR : typeof m.GLOBSTAR -->q : number -+>GLOBSTAR.q : any -+>GLOBSTAR : {} -+>q : any ++>GLOBSTAR : { q: number; } + >q : number m.GLOBSTAR.p ->m.GLOBSTAR.p : number @@ -67,19 +64,17 @@ ->GLOBSTAR : typeof m.GLOBSTAR ->p : number +>m.GLOBSTAR.p : any -+>m.GLOBSTAR : {} -+>m : { (): void; GLOBSTAR: {}; } -+>GLOBSTAR : {} ++>m.GLOBSTAR : { q: number; } ++>m : { (): void; GLOBSTAR: { q: number; }; } ++>GLOBSTAR : { q: number; } +>p : any m.GLOBSTAR.q -->m.GLOBSTAR.q : number + >m.GLOBSTAR.q : number ->m.GLOBSTAR : typeof m.GLOBSTAR ->m : typeof m ->GLOBSTAR : typeof m.GLOBSTAR -->q : number -+>m.GLOBSTAR.q : any -+>m.GLOBSTAR : {} -+>m : { (): void; GLOBSTAR: {}; } -+>GLOBSTAR : {} -+>q : any ++>m.GLOBSTAR : { q: number; } ++>m : { (): void; GLOBSTAR: { q: number; }; } ++>GLOBSTAR : { q: number; } + >q : number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.errors.txt.diff index e800b484cd..1d22ed67e3 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.errors.txt.diff @@ -2,22 +2,18 @@ +++ new.typeFromPropertyAssignment24.errors.txt @@= skipped -0, +0 lines =@@ - -+def.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+usage.js(2,7): error TS2339: Property 'Inner' does not exist on type '{}'. -+usage.js(5,19): error TS2339: Property 'Inner' does not exist on type '{}'. ++usage.js(2,13): error TS2339: Property 'Message' does not exist on type 'typeof Inner'. +usage.js(7,12): error TS2503: Cannot find namespace 'Outer'. + + -+==== usage.js (3 errors) ==== ++==== usage.js (2 errors) ==== + // note that usage is first in the compilation + Outer.Inner.Message = function() { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. ++ ~~~~~~~ ++!!! error TS2339: Property 'Message' does not exist on type 'typeof Inner'. + }; + + var y = new Outer.Inner() -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + y.name + /** @type {Outer.Inner} should be instance type, not static type */ + ~~~~~ @@ -25,11 +21,9 @@ + var x; + x.name + -+==== def.js (1 errors) ==== ++==== def.js (0 errors) ==== + var Outer = {} + Outer.Inner = class { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '{}'. + name() { + return 'hi' + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.types.diff index b034e3ab27..3f11a54f9b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment24.types.diff @@ -5,38 +5,26 @@ Outer.Inner.Message = function() { >Outer.Inner.Message = function() {} : () => void ->Outer.Inner.Message : () => void -->Outer.Inner : typeof Inner ++>Outer.Inner.Message : any + >Outer.Inner : typeof Inner ->Outer : typeof Outer -->Inner : typeof Inner ++>Outer : { Inner: typeof Inner; } + >Inner : typeof Inner ->Message : () => void -+>Outer.Inner.Message : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any +>Message : any >function() {} : () => void }; - - var y = new Outer.Inner() -->y : Inner -->new Outer.Inner() : Inner -->Outer.Inner : typeof Inner +@@= skipped -13, +13 lines =@@ + >y : Inner + >new Outer.Inner() : Inner + >Outer.Inner : typeof Inner ->Outer : typeof Outer -->Inner : typeof Inner -+>y : any -+>new Outer.Inner() : any -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer : { Inner: typeof Inner; } + >Inner : typeof Inner y.name -->y.name : () => string -->y : Inner -->name : () => string -+>y.name : any -+>y : any -+>name : any +@@= skipped -10, +10 lines =@@ /** @type {Outer.Inner} should be instance type, not static type */ var x; @@ -54,17 +42,14 @@ === def.js === var Outer = {} ->Outer : typeof Outer -+>Outer : {} - >{} : {} +->{} : {} ++>Outer : { Inner: typeof Inner; } ++>{} : { Inner: typeof Inner; } Outer.Inner = class { >Outer.Inner = class { name() { return 'hi' }} : typeof Inner -->Outer.Inner : typeof Inner + >Outer.Inner : typeof Inner ->Outer : typeof Outer -->Inner : typeof Inner -+>Outer.Inner : any -+>Outer : {} -+>Inner : any ++>Outer : { Inner: typeof Inner; } + >Inner : typeof Inner >class { name() { return 'hi' }} : typeof Inner - - name() { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.errors.txt.diff deleted file mode 100644 index 2be8774f3d..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.errors.txt.diff +++ /dev/null @@ -1,41 +0,0 @@ ---- old.typeFromPropertyAssignment25.errors.txt -+++ new.typeFromPropertyAssignment25.errors.txt -@@= skipped -0, +0 lines =@@ -- -+bug24703.js(2,8): error TS2339: Property 'I' does not exist on type '{}'. -+bug24703.js(7,8): error TS2339: Property 'O' does not exist on type '{}'. -+bug24703.js(7,33): error TS2339: Property 'I' does not exist on type '{}'. -+bug24703.js(13,20): error TS2339: Property 'O' does not exist on type '{}'. -+bug24703.js(14,20): error TS2339: Property 'I' does not exist on type '{}'. -+ -+ -+==== bug24703.js (5 errors) ==== -+ var Common = {}; -+ Common.I = class { -+ ~ -+!!! error TS2339: Property 'I' does not exist on type '{}'. -+ constructor() { -+ this.i = 1 -+ } -+ } -+ Common.O = class extends Common.I { -+ ~ -+!!! error TS2339: Property 'O' does not exist on type '{}'. -+ ~ -+!!! error TS2339: Property 'I' does not exist on type '{}'. -+ constructor() { -+ super() -+ this.o = 2 -+ } -+ } -+ var o = new Common.O() -+ ~ -+!!! error TS2339: Property 'O' does not exist on type '{}'. -+ var i = new Common.I() -+ ~ -+!!! error TS2339: Property 'I' does not exist on type '{}'. -+ o.i -+ o.o -+ i.i -+ -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.types.diff index 3c13f0c400..591850c4fd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment25.types.diff @@ -5,17 +5,16 @@ === bug24703.js === var Common = {}; ->Common : typeof Common -+>Common : {} - >{} : {} +->{} : {} ++>Common : { I: typeof I; O: typeof O; } ++>{} : { I: typeof I; O: typeof O; } Common.I = class { >Common.I = class { constructor() { this.i = 1 }} : typeof I -->Common.I : typeof I + >Common.I : typeof I ->Common : typeof Common -->I : typeof I -+>Common.I : any -+>Common : {} -+>I : any ++>Common : { I: typeof I; O: typeof O; } + >I : typeof I >class { constructor() { this.i = 1 }} : typeof I constructor() { @@ -31,25 +30,18 @@ } Common.O = class extends Common.I { >Common.O = class extends Common.I { constructor() { super() this.o = 2 }} : typeof O -->Common.O : typeof O + >Common.O : typeof O ->Common : typeof Common -->O : typeof O -+>Common.O : any -+>Common : {} -+>O : any ++>Common : { I: typeof I; O: typeof O; } + >O : typeof O >class extends Common.I { constructor() { super() this.o = 2 }} : typeof O -->Common.I : I + >Common.I : I ->Common : typeof Common -->I : typeof I -+>Common.I : any -+>Common : {} -+>I : any ++>Common : { I: typeof I; O: typeof O; } + >I : typeof I constructor() { - super() - >super() : void -->super : typeof I -+>super : any +@@= skipped -36, +36 lines =@@ this.o = 2 >this.o = 2 : 2 @@ -61,51 +53,20 @@ >2 : 2 } } - var o = new Common.O() -->o : O -->new Common.O() : O -->Common.O : typeof O +@@= skipped -10, +10 lines =@@ + >o : O + >new Common.O() : O + >Common.O : typeof O ->Common : typeof Common -->O : typeof O -+>o : any -+>new Common.O() : any -+>Common.O : any -+>Common : {} -+>O : any ++>Common : { I: typeof I; O: typeof O; } + >O : typeof O var i = new Common.I() -->i : I -->new Common.I() : I -->Common.I : typeof I + >i : I + >new Common.I() : I + >Common.I : typeof I ->Common : typeof Common -->I : typeof I -+>i : any -+>new Common.I() : any -+>Common.I : any -+>Common : {} -+>I : any - - o.i -->o.i : number -->o : O -->i : number -+>o.i : any -+>o : any -+>i : any - - o.o -->o.o : number -->o : O -->o : number -+>o.o : any -+>o : any -+>o : any - - i.i -->i.i : number -->i : I -->i : number -+>i.i : any -+>i : any -+>i : any ++>Common : { I: typeof I; O: typeof O; } + >I : typeof I + o.i \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.errors.txt.diff deleted file mode 100644 index c8d7a171ef..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.errors.txt.diff +++ /dev/null @@ -1,45 +0,0 @@ ---- old.typeFromPropertyAssignment26.errors.txt -+++ new.typeFromPropertyAssignment26.errors.txt -@@= skipped -0, +0 lines =@@ -+bug24730.js(2,4): error TS2339: Property 'TreeElement' does not exist on type '{}'. -+bug24730.js(7,4): error TS2339: Property 'context' does not exist on type '{}'. -+bug24730.js(7,21): error TS2339: Property 'TreeElement' does not exist on type '{}'. -+bug24730.js(9,20): error TS2339: Property 'TreeElement' does not exist on type '{}'. - bug24730.js(11,14): error TS2339: Property 'doesNotExist' does not exist on type 'C'. --bug24730.js(12,26): error TS2339: Property 'doesntExistEither' does not exist on type 'number'. -- -- --==== bug24730.js (2 errors) ==== -+bug24730.js(12,14): error TS2339: Property 'treeOutline' does not exist on type 'C'. -+ -+ -+==== bug24730.js (6 errors) ==== - var UI = {} - UI.TreeElement = class { -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. - constructor() { - this.treeOutline = 12 - } - }; - UI.context = new UI.TreeElement() -+ ~~~~~~~ -+!!! error TS2339: Property 'context' does not exist on type '{}'. -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. - - class C extends UI.TreeElement { -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'TreeElement' does not exist on type '{}'. - onpopulate() { - this.doesNotExist - ~~~~~~~~~~~~ - !!! error TS2339: Property 'doesNotExist' does not exist on type 'C'. - this.treeOutline.doesntExistEither() -- ~~~~~~~~~~~~~~~~~ --!!! error TS2339: Property 'doesntExistEither' does not exist on type 'number'. -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'treeOutline' does not exist on type 'C'. - } - }; - \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.types.diff index d05399e825..a482207a36 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment26.types.diff @@ -5,17 +5,16 @@ === bug24730.js === var UI = {} ->UI : typeof UI -+>UI : {} - >{} : {} +->{} : {} ++>UI : { TreeElement: typeof TreeElement; context: TreeElement; } ++>{} : { TreeElement: typeof TreeElement; context: TreeElement; } UI.TreeElement = class { >UI.TreeElement = class { constructor() { this.treeOutline = 12 }} : typeof TreeElement -->UI.TreeElement : typeof TreeElement + >UI.TreeElement : typeof TreeElement ->UI : typeof UI -->TreeElement : typeof TreeElement -+>UI.TreeElement : any -+>UI : {} -+>TreeElement : any ++>UI : { TreeElement: typeof TreeElement; context: TreeElement; } + >TreeElement : typeof TreeElement >class { constructor() { this.treeOutline = 12 }} : typeof TreeElement constructor() { @@ -30,43 +29,22 @@ } }; UI.context = new UI.TreeElement() -->UI.context = new UI.TreeElement() : TreeElement -->UI.context : TreeElement + >UI.context = new UI.TreeElement() : TreeElement + >UI.context : TreeElement ->UI : typeof UI -->context : TreeElement -->new UI.TreeElement() : TreeElement -->UI.TreeElement : typeof TreeElement ++>UI : { TreeElement: typeof TreeElement; context: TreeElement; } + >context : TreeElement + >new UI.TreeElement() : TreeElement + >UI.TreeElement : typeof TreeElement ->UI : typeof UI -->TreeElement : typeof TreeElement -+>UI.context = new UI.TreeElement() : any -+>UI.context : any -+>UI : {} -+>context : any -+>new UI.TreeElement() : any -+>UI.TreeElement : any -+>UI : {} -+>TreeElement : any ++>UI : { TreeElement: typeof TreeElement; context: TreeElement; } + >TreeElement : typeof TreeElement class C extends UI.TreeElement { >C : C -->UI.TreeElement : TreeElement + >UI.TreeElement : TreeElement ->UI : typeof UI -->TreeElement : typeof TreeElement -+>UI.TreeElement : any -+>UI : {} -+>TreeElement : any ++>UI : { TreeElement: typeof TreeElement; context: TreeElement; } + >TreeElement : typeof TreeElement - onpopulate() { - >onpopulate : () => void -@@= skipped -46, +46 lines =@@ - this.treeOutline.doesntExistEither() - >this.treeOutline.doesntExistEither() : any - >this.treeOutline.doesntExistEither : any -->this.treeOutline : number -+>this.treeOutline : any - >this : this -->treeOutline : number -+>treeOutline : any - >doesntExistEither : any - } - }; \ No newline at end of file + onpopulate() { \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.errors.txt.diff index 315f8936ae..8f97d07393 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.errors.txt.diff @@ -2,18 +2,15 @@ +++ new.typeFromPropertyAssignment3.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(4,7): error TS2339: Property 'Inner' does not exist on type '() => void'. +a.js(9,12): error TS2749: 'Outer' refers to a value, but is being used as a type here. Did you mean 'typeof Outer'? +a.js(12,12): error TS2503: Cannot find namespace 'Outer'. + + -+==== a.js (3 errors) ==== ++==== a.js (2 errors) ==== + var Outer = function O() { + this.y = 2 + } + Outer.Inner = class I { -+ ~~~~~ -+!!! error TS2339: Property 'Inner' does not exist on type '() => void'. + constructor() { + this.x = 1 + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.types.diff index c5821d3286..aade094ed8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment3.types.diff @@ -7,9 +7,9 @@ ->Outer : typeof O ->function O() { this.y = 2} : typeof O ->O : typeof O -+>Outer : () => void -+>function O() { this.y = 2} : () => void -+>O : () => void ++>Outer : { (): void; Inner: typeof I; } ++>function O() { this.y = 2} : { (): void; Inner: typeof I; } ++>O : { (): void; Inner: typeof I; } this.y = 2 >this.y = 2 : 2 @@ -21,15 +21,13 @@ } Outer.Inner = class I { >Outer.Inner = class I { constructor() { this.x = 1 }} : typeof I -->Outer.Inner : typeof I + >Outer.Inner : typeof I ->Outer : typeof O -->Inner : typeof I -+>Outer.Inner : any -+>Outer : () => void -+>Inner : any ++>Outer : { (): void; Inner: typeof I; } + >Inner : typeof I >class I { constructor() { this.x = 1 }} : typeof I >I : typeof I - +@@= skipped -22, +22 lines =@@ constructor() { this.x = 1 >this.x = 1 : 1 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.errors.txt.diff index bd9ccabefe..f488e37506 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.errors.txt.diff @@ -2,22 +2,19 @@ +++ new.typeFromPropertyAssignment34.errors.txt @@= skipped -0, +0 lines =@@ - -+file1.js(2,3): error TS2339: Property 'commands' does not exist on type '{}'. -+file2.js(1,3): error TS2339: Property 'commands' does not exist on type '{}'. -+file2.js(2,3): error TS2339: Property 'commands' does not exist on type '{}'. ++file2.js(1,12): error TS2339: Property 'a' does not exist on type '{}'. ++file2.js(2,12): error TS2339: Property 'b' does not exist on type '{}'. + + -+==== file1.js (1 errors) ==== ++==== file1.js (0 errors) ==== + var N = {}; + N.commands = {}; -+ ~~~~~~~~ -+!!! error TS2339: Property 'commands' does not exist on type '{}'. + +==== file2.js (2 errors) ==== + N.commands.a = 111; -+ ~~~~~~~~ -+!!! error TS2339: Property 'commands' does not exist on type '{}'. ++ ~ ++!!! error TS2339: Property 'a' does not exist on type '{}'. + N.commands.b = function () { }; -+ ~~~~~~~~ -+!!! error TS2339: Property 'commands' does not exist on type '{}'. ++ ~ ++!!! error TS2339: Property 'b' does not exist on type '{}'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.types.diff index c2e3462306..129c119267 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment34.types.diff @@ -5,8 +5,9 @@ === file1.js === var N = {}; ->N : typeof N -+>N : {} - >{} : {} +->{} : {} ++>N : { commands: {}; } ++>{} : { commands: {}; } N.commands = {}; ->N.commands = {} : typeof N.commands @@ -14,9 +15,9 @@ ->N : typeof N ->commands : typeof N.commands +>N.commands = {} : {} -+>N.commands : any -+>N : {} -+>commands : any ++>N.commands : {} ++>N : { commands: {}; } ++>commands : {} >{} : {} === file2.js === @@ -28,9 +29,9 @@ ->commands : typeof N.commands ->a : number +>N.commands.a : any -+>N.commands : any -+>N : {} -+>commands : any ++>N.commands : {} ++>N : { commands: {}; } ++>commands : {} +>a : any >111 : 111 @@ -42,8 +43,8 @@ ->commands : typeof N.commands ->b : () => void +>N.commands.b : any -+>N.commands : any -+>N : {} -+>commands : any ++>N.commands : {} ++>N : { commands: {}; } ++>commands : {} +>b : any >function () { } : () => void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.errors.txt.diff deleted file mode 100644 index f7ee93daf8..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.typeFromPropertyAssignment39.errors.txt -+++ new.typeFromPropertyAssignment39.errors.txt -@@= skipped -0, +0 lines =@@ -- -+a.js(2,1): error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -+ Property 'baz' does not exist on type '{}'. -+a.js(3,1): error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -+ Property 'baz' does not exist on type '{}'. -+ -+ -+==== a.js (2 errors) ==== -+ const foo = {}; -+ foo["baz"] = {}; -+ ~~~~~~~~~~ -+!!! error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -+!!! error TS7053: Property 'baz' does not exist on type '{}'. -+ foo["baz"]["blah"] = 3; -+ ~~~~~~~~~~ -+!!! error TS7053: Element implicitly has an 'any' type because expression of type '"baz"' can't be used to index type '{}'. -+!!! error TS7053: Property 'baz' does not exist on type '{}'. -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.types.diff index be97d0466f..b7dda868c7 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment39.types.diff @@ -5,27 +5,28 @@ === a.js === const foo = {}; ->foo : typeof foo -+>foo : {} - >{} : {} +->{} : {} ++>foo : { baz: { blah: number; }; } ++>{} : { baz: { blah: number; }; } foo["baz"] = {}; ->foo["baz"] = {} : typeof foo.baz ->foo["baz"] : typeof foo.baz ->foo : typeof foo -+>foo["baz"] = {} : {} -+>foo["baz"] : any -+>foo : {} ++>foo["baz"] = {} : { blah: number; } ++>foo["baz"] : { blah: number; } ++>foo : { baz: { blah: number; }; } >"baz" : "baz" - >{} : {} +->{} : {} ++>{} : { blah: number; } foo["baz"]["blah"] = 3; >foo["baz"]["blah"] = 3 : 3 -->foo["baz"]["blah"] : number + >foo["baz"]["blah"] : number ->foo["baz"] : typeof foo.baz ->foo : typeof foo -+>foo["baz"]["blah"] : any -+>foo["baz"] : any -+>foo : {} ++>foo["baz"] : { blah: number; } ++>foo : { baz: { blah: number; }; } >"baz" : "baz" >"blah" : "blah" >3 : 3 \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.errors.txt.diff index 674471f05f..3ee1f1f7e3 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.errors.txt.diff @@ -2,18 +2,16 @@ +++ new.typeFromPropertyAssignment7.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(2,5): error TS2339: Property 'method' does not exist on type '{}'. -+a.js(5,13): error TS2339: Property 'method' does not exist on type '{}'. ++a.js(5,13): error TS2554: Expected 1 arguments, but got 0. + + -+==== a.js (2 errors) ==== ++==== a.js (1 errors) ==== + var obj = {}; + obj.method = function (hunch) { -+ ~~~~~~ -+!!! error TS2339: Property 'method' does not exist on type '{}'. + return true; + } + var b = obj.method(); + ~~~~~~ -+!!! error TS2339: Property 'method' does not exist on type '{}'. ++!!! error TS2554: Expected 1 arguments, but got 0. ++!!! related TS6210 a.js:2:24: An argument for 'hunch' was not provided. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.types.diff index 0f0464f384..308b72fb31 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment7.types.diff @@ -5,31 +5,22 @@ === a.js === var obj = {}; ->obj : typeof obj -+>obj : {} - >{} : {} +->{} : {} ++>obj : { method: (hunch: any) => boolean; } ++>{} : { method: (hunch: any) => boolean; } obj.method = function (hunch) { >obj.method = function (hunch) { return true;} : (hunch: any) => boolean -->obj.method : (hunch: any) => boolean + >obj.method : (hunch: any) => boolean ->obj : typeof obj -->method : (hunch: any) => boolean -+>obj.method : any -+>obj : {} -+>method : any ++>obj : { method: (hunch: any) => boolean; } + >method : (hunch: any) => boolean >function (hunch) { return true;} : (hunch: any) => boolean >hunch : any - -@@= skipped -15, +15 lines =@@ - >true : true - } - var b = obj.method(); -->b : boolean -->obj.method() : boolean -->obj.method : (hunch: any) => boolean +@@= skipped -18, +18 lines =@@ + >b : boolean + >obj.method() : boolean + >obj.method : (hunch: any) => boolean ->obj : typeof obj -->method : (hunch: any) => boolean -+>b : any -+>obj.method() : any -+>obj.method : any -+>obj : {} -+>method : any ++>obj : { method: (hunch: any) => boolean; } + >method : (hunch: any) => boolean diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.errors.txt.diff deleted file mode 100644 index f247647019..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.typeFromPropertyAssignmentWithExport.errors.txt -+++ new.typeFromPropertyAssignmentWithExport.errors.txt -@@= skipped -0, +0 lines =@@ -- -+a.js(5,9): error TS2339: Property 'prop' does not exist on type '{}'. -+a.js(8,9): error TS2339: Property 'asyncMethod' does not exist on type '{}'. -+ -+ -+==== a.js (2 errors) ==== -+ // this is a javascript file... -+ -+ export const Adapter = {}; -+ -+ Adapter.prop = {}; -+ ~~~~ -+!!! error TS2339: Property 'prop' does not exist on type '{}'. -+ -+ // comment this out, and it works -+ Adapter.asyncMethod = function() {} -+ ~~~~~~~~~~~ -+!!! error TS2339: Property 'asyncMethod' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.types.diff index f5b94741e0..8d093dfbf9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignmentWithExport.types.diff @@ -5,26 +5,23 @@ export const Adapter = {}; ->Adapter : typeof Adapter -+>Adapter : {} - >{} : {} +->{} : {} ++>Adapter : { prop: {}; asyncMethod: () => void; } ++>{} : { prop: {}; asyncMethod: () => void; } Adapter.prop = {}; >Adapter.prop = {} : {} -->Adapter.prop : {} + >Adapter.prop : {} ->Adapter : typeof Adapter -->prop : {} -+>Adapter.prop : any -+>Adapter : {} -+>prop : any ++>Adapter : { prop: {}; asyncMethod: () => void; } + >prop : {} >{} : {} - // comment this out, and it works +@@= skipped -14, +14 lines =@@ Adapter.asyncMethod = function() {} >Adapter.asyncMethod = function() {} : () => void -->Adapter.asyncMethod : () => void + >Adapter.asyncMethod : () => void ->Adapter : typeof Adapter -->asyncMethod : () => void -+>Adapter.asyncMethod : any -+>Adapter : {} -+>asyncMethod : any ++>Adapter : { prop: {}; asyncMethod: () => void; } + >asyncMethod : () => void >function() {} : () => void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.errors.txt.diff index 559e5168ba..6abc9ef630 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.errors.txt.diff @@ -1,19 +1,25 @@ --- old.typeFromPrototypeAssignment.errors.txt +++ new.typeFromPrototypeAssignment.errors.txt @@= skipped -0, +0 lines =@@ --a.js(27,20): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. -- -- --==== a.js (1 errors) ==== +a.js(5,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(6,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(7,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(8,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(9,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. ++a.js(14,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(17,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(20,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(23,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + a.js(27,20): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +- +- +-==== a.js (1 errors) ==== ++a.js(28,10): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(31,10): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(34,10): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + -+==== a.js (6 errors) ==== ++==== a.js (13 errors) ==== // all references to _map, set, get, addon should be ok /** @constructor */ @@ -36,16 +42,39 @@ }; Multimap.prototype = { -@@= skipped -28, +43 lines =@@ + set: function() { + this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. + this.set + this.get + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + }, + get() { + this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. + this.set + this.get + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + } } - Multimap.prototype.addon = function () { -- ~~~~~ --!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +@@= skipped -31, +61 lines =@@ + ~~~~~ + !!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get -@@= skipped -9, +7 lines =@@ + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.types.diff index bcfe6f3457..c6ca2ec205 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment.types.diff @@ -6,8 +6,8 @@ var Multimap = function() { ->Multimap : typeof Multimap ->function() { this._map = {}; this._map this.set this.get this.addon} : typeof Multimap -+>Multimap : () => void -+>function() { this._map = {}; this._map this.set this.get this.addon} : () => void ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } ++>function() { this._map = {}; this._map this.set this.get this.addon} : { (): void; prototype: { set: () => void; get(): void; }; } this._map = {}; >this._map = {} : {} @@ -53,15 +53,12 @@ Multimap.prototype = { >Multimap.prototype = { set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon }} : { set: () => void; get(): void; } -->Multimap.prototype : { set: () => void; get(): void; } + >Multimap.prototype : { set: () => void; get(): void; } ->Multimap : typeof Multimap -->prototype : { set: () => void; get(): void; } -+>Multimap.prototype : any -+>Multimap : () => void -+>prototype : any ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } + >prototype : { set: () => void; get(): void; } >{ set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon }} : { set: () => void; get(): void; } - set: function() { @@= skipped -44, +44 lines =@@ >function() { this._map this.set this.get this.addon } : () => void @@ -70,31 +67,27 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any }, @@ -106,44 +99,38 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any } } - Multimap.prototype.addon = function () { +@@= skipped -49, +49 lines =@@ >Multimap.prototype.addon = function () { this._map this.set this.get this.addon} : () => void >Multimap.prototype.addon : any -->Multimap.prototype : { set: () => void; get(): void; } + >Multimap.prototype : { set: () => void; get(): void; } ->Multimap : typeof Multimap -->prototype : { set: () => void; get(): void; } -+>Multimap.prototype : any -+>Multimap : () => void -+>prototype : any ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } + >prototype : { set: () => void; get(): void; } >addon : any >function () { this._map this.set this.get this.addon} : () => void @@ -152,31 +139,27 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any } @@ -186,7 +169,7 @@ ->Multimap : typeof Multimap +>mm : any +>new Multimap() : any -+>Multimap : () => void ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } mm._map ->mm._map : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.errors.txt.diff index 59c716af41..c698de8479 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.errors.txt.diff @@ -1,19 +1,25 @@ --- old.typeFromPrototypeAssignment2.errors.txt +++ new.typeFromPrototypeAssignment2.errors.txt @@= skipped -0, +0 lines =@@ --a.js(28,24): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. -- -- --==== a.js (1 errors) ==== +a.js(6,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(7,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(8,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(9,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +a.js(10,9): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. ++a.js(15,18): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(18,18): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(21,18): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(24,18): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + a.js(28,24): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +- +- +-==== a.js (1 errors) ==== ++a.js(29,14): error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. ++a.js(32,14): error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +a.js(35,14): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + -+==== a.js (6 errors) ==== ++==== a.js (13 errors) ==== // non top-level: // all references to _map, set, get, addon should be ok (function container() { @@ -37,16 +43,39 @@ }; Multimap.prototype = { -@@= skipped -29, +44 lines =@@ + set: function() { + this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. + this.set + this.get + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + }, + get() { + this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. + this.set + this.get + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. + } } - Multimap.prototype.addon = function () { -- ~~~~~ --!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. +@@= skipped -32, +62 lines =@@ + ~~~~~ + !!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. this._map ++ ~~~~ ++!!! error TS2339: Property '_map' does not exist on type '{ set: () => void; get(): void; }'. this.set this.get -@@= skipped -9, +7 lines =@@ + this.addon ++ ~~~~~ ++!!! error TS2339: Property 'addon' does not exist on type '{ set: () => void; get(): void; }'. } var mm = new Multimap(); diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.types.diff index fea2045658..e6a3eb0367 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPrototypeAssignment2.types.diff @@ -6,8 +6,8 @@ var Multimap = function() { ->Multimap : typeof Multimap ->function() { this._map = {}; this._map this.set this.get this.addon } : typeof Multimap -+>Multimap : () => void -+>function() { this._map = {}; this._map this.set this.get this.addon } : () => void ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } ++>function() { this._map = {}; this._map this.set this.get this.addon } : { (): void; prototype: { set: () => void; get(): void; }; } this._map = {}; >this._map = {} : {} @@ -53,15 +53,12 @@ Multimap.prototype = { >Multimap.prototype = { set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon } } : { set: () => void; get(): void; } -->Multimap.prototype : { set: () => void; get(): void; } + >Multimap.prototype : { set: () => void; get(): void; } ->Multimap : typeof Multimap -->prototype : { set: () => void; get(): void; } -+>Multimap.prototype : any -+>Multimap : () => void -+>prototype : any ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } + >prototype : { set: () => void; get(): void; } >{ set: function() { this._map this.set this.get this.addon }, get() { this._map this.set this.get this.addon } } : { set: () => void; get(): void; } - set: function() { @@= skipped -44, +44 lines =@@ >function() { this._map this.set this.get this.addon } : () => void @@ -70,31 +67,27 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any }, @@ -106,44 +99,38 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any } } - Multimap.prototype.addon = function () { +@@= skipped -49, +49 lines =@@ >Multimap.prototype.addon = function () { this._map this.set this.get this.addon } : () => void >Multimap.prototype.addon : any -->Multimap.prototype : { set: () => void; get(): void; } + >Multimap.prototype : { set: () => void; get(): void; } ->Multimap : typeof Multimap -->prototype : { set: () => void; get(): void; } -+>Multimap.prototype : any -+>Multimap : () => void -+>prototype : any ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } + >prototype : { set: () => void; get(): void; } >addon : any >function () { this._map this.set this.get this.addon } : () => void @@ -152,31 +139,27 @@ ->this : this ->_map : {} +>this._map : any -+>this : any ++>this : { set: () => void; get(): void; } +>_map : any this.set -->this.set : () => void + >this.set : () => void ->this : this -->set : () => void -+>this.set : any -+>this : any -+>set : any ++>this : { set: () => void; get(): void; } + >set : () => void this.get -->this.get : () => void + >this.get : () => void ->this : this -->get : () => void -+>this.get : any -+>this : any -+>get : any ++>this : { set: () => void; get(): void; } + >get : () => void this.addon ->this.addon : () => void ->this : this ->addon : () => void +>this.addon : any -+>this : any ++>this : { set: () => void; get(): void; } +>addon : any } @@ -186,7 +169,7 @@ ->Multimap : typeof Multimap +>mm : any +>new Multimap() : any -+>Multimap : () => void ++>Multimap : { (): void; prototype: { set: () => void; get(): void; }; } mm._map ->mm._map : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff index f8517bf3e1..36296f2c15 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff @@ -3,21 +3,22 @@ @@= skipped -0, +0 lines =@@ -mod2.js(1,23): error TS2300: Duplicate identifier 'Foo'. -mod2.js(3,4): error TS2300: Duplicate identifier 'Foo'. -+mod2.js(3,4): error TS2339: Property 'Foo' does not exist on type '{}'. +- +- +-==== mod2.js (2 errors) ==== +mod2.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. - - - ==== mod2.js (2 errors) ==== ++ ++ ++==== mod2.js (1 errors) ==== /** @typedef {number} Foo */ - ~~~ -!!! error TS2300: Duplicate identifier 'Foo'. -!!! related TS6203 mod2.js:3:4: 'Foo' was also declared here. const ns = {}; ns.Foo = class {} - ~~~ +- ~~~ -!!! error TS2300: Duplicate identifier 'Foo'. -!!! related TS6203 mod2.js:1:23: 'Foo' was also declared here. -+!!! error TS2339: Property 'Foo' does not exist on type '{}'. module.exports = ns; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff index d922f9ca2c..84c40ae802 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff @@ -5,17 +5,16 @@ /** @typedef {number} Foo */ const ns = {}; ->ns : typeof ns -+>ns : {} - >{} : {} +->{} : {} ++>ns : { Foo: typeof Foo; } ++>{} : { Foo: typeof Foo; } ns.Foo = class {} >ns.Foo = class {} : typeof Foo -->ns.Foo : typeof Foo + >ns.Foo : typeof Foo ->ns : typeof ns -->Foo : typeof Foo -+>ns.Foo : any -+>ns : {} -+>Foo : any ++>ns : { Foo: typeof Foo; } + >Foo : typeof Foo >class {} : typeof Foo module.exports = ns; @@ -24,9 +23,9 @@ ->module : { exports: typeof ns; } ->exports : typeof ns ->ns : typeof ns -+>module.exports = ns : {} -+>module.exports : {} -+>module : { readonly ns: {}; } -+>exports : {} -+>ns : {} ++>module.exports = ns : { Foo: typeof Foo; } ++>module.exports : { Foo: typeof Foo; } ++>module : { readonly ns: { Foo: typeof Foo; }; } ++>exports : { Foo: typeof Foo; } ++>ns : { Foo: typeof Foo; }