2014-09-12 22:35:07 +02:00
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
2014-11-29 23:51:25 +01:00
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,39): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(10,30): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,35): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(29,36): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(29,55): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(67,54): error TS2304: Cannot find name 'SignatureGroup'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(67,77): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(67,104): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(83,38): error TS2304: Cannot find name 'ParameterSymbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(94,32): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(94,51): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(94,71): error TS2304: Cannot find name 'Type'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(103,39): error TS2304: Cannot find name 'SymbolTableScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(104,31): error TS2304: Cannot find name 'SymbolAggregateScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(110,52): error TS2304: Cannot find name 'ModuleDeclaration'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(145,34): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(145,55): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(152,26): error TS2304: Cannot find name 'SymbolKind'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(154,44): error TS2304: Cannot find name 'SymbolFlags'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(158,43): error TS2304: Cannot find name 'TypeSymbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(159,45): error TS2304: Cannot find name 'SymbolFlags'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(166,112): error TS2304: Cannot find name 'NodeType'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(167,45): error TS2304: Cannot find name 'Identifier'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(185,26): error TS2304: Cannot find name 'SymbolKind'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(186,63): error TS2304: Cannot find name 'FieldSymbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(189,26): error TS2304: Cannot find name 'SymbolKind'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(191,51): error TS2304: Cannot find name 'ParameterSymbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts (33 errors) ====
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
// See LICENSE.txt in the project root for complete license information.
///<reference path='typescript.ts' />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS6053: File 'typescript.ts' not found.
2014-07-13 01:04:16 +02:00
module TypeScript {
export class Binder {
constructor (public checker: TypeChecker) { }
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'TypeChecker'.
2014-07-13 01:04:16 +02:00
public resolveBaseTypeLinks(typeLinks: TypeLink[], scope: SymbolScope) {
~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'TypeLink'.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
var extendsList: Type[] = null;
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
if (typeLinks) {
extendsList = new Type[];
2014-11-29 23:51:25 +01:00
~~
2014-09-12 00:19:57 +02:00
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
for (var i = 0, len = typeLinks.length; i < len; i++) {
var typeLink = typeLinks[i];
this.checker.resolvingBases = true;
this.checker.resolveTypeLink(scope, typeLink, true);
this.checker.resolvingBases = false;
if (typeLink.type.isClass()) {
extendsList[i] = typeLink.type.instanceType;
}
else {
extendsList[i] = typeLink.type;
}
}
}
return extendsList;
}
public resolveBases(scope: SymbolScope, type: Type) {
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
type.extendsList = this.resolveBaseTypeLinks(type.extendsTypeLinks, scope);
var i = 0, len = type.extendsList.length;
var derivedIsClass = type.isClassInstance();
for (; i < len; i++) {
var baseIsClass = type.extendsList[i].isClassInstance();
if (type.extendsList[i] != this.checker.anyType) {
if (derivedIsClass) {
if (!baseIsClass) {
this.checker.errorReporter.simpleErrorFromSym(type.symbol,
"A export class may only extend other classes, " + type.extendsList[i].symbol.fullName() + " is an interface.");
}
}
else {
if (baseIsClass) {
this.checker.errorReporter.simpleErrorFromSym(type.symbol,
"An interface may only extend other interfaces, " + type.extendsList[i].symbol.fullName() + " is a class.");
}
}
}
}
type.implementsList = this.resolveBaseTypeLinks(type.implementsTypeLinks, scope);
if (type.implementsList) {
for (i = 0, len = type.implementsList.length; i < len; i++) {
var iface = type.implementsList[i];
if (iface.isClassInstance()) {
if (derivedIsClass) {
this.checker.errorReporter.simpleErrorFromSym(type.symbol,
"A class may only implement an interface; " + iface.symbol.fullName() + " is a class.");
}
}
}
}
}
public resolveSignatureGroup(signatureGroup: SignatureGroup, scope: SymbolScope, instanceType: Type) {
~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SignatureGroup'.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
var supplyVar = !(signatureGroup.hasImplementation);
for (var i = 0, len = signatureGroup.signatures.length; i < len; i++) {
var signature = signatureGroup.signatures[i];
if (instanceType) {
signature.returnType.type = instanceType;
}
else {
this.checker.resolveTypeLink(scope, signature.returnType, supplyVar);
}
var paramLen = signature.parameters.length;
for (var j = 0; j < paramLen; j++) {
this.bindSymbol(scope, signature.parameters[j]);
}
if (signature.hasVariableArgList) {
// check that last parameter has an array type
var lastParam = <ParameterSymbol>signature.parameters[paramLen - 1];
~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'ParameterSymbol'.
2014-07-13 01:04:16 +02:00
lastParam.argsOffset = paramLen - 1;
if (!lastParam.getType().isArray()) {
this.checker.errorReporter.simpleErrorFromSym(lastParam,
"... parameter must have array type");
lastParam.parameter.typeLink.type = this.checker.makeArrayType(lastParam.parameter.typeLink.type);
}
}
}
}
public bindType(scope: SymbolScope, type: Type, instanceType: Type): void {
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Type'.
2014-07-13 01:04:16 +02:00
if (instanceType) {
this.bindType(scope, instanceType, null);
}
if (type.hasMembers()) {
var members = type.members;
var ambientMembers = type.ambientMembers;
var typeMembers = type.getAllEnclosedTypes(); // REVIEW: Should only be getting exported types?
var ambientTypeMembers = type.getAllAmbientEnclosedTypes(); // REVIEW: Should only be getting exported types?
var memberScope = new SymbolTableScope(members, ambientMembers, typeMembers, ambientTypeMembers, type.symbol);
~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolTableScope'.
2014-07-13 01:04:16 +02:00
var agg = new SymbolAggregateScope(type.symbol);
~~~~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
2014-07-13 01:04:16 +02:00
var prevCurrentModDecl = this.checker.currentModDecl;
var prevBindStatus = this.checker.inBind;
agg.addParentScope(memberScope);
agg.addParentScope(scope);
if (type.isModuleType()) {
this.checker.currentModDecl = <ModuleDeclaration>type.symbol.declAST;
~~~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'ModuleDeclaration'.
2014-07-13 01:04:16 +02:00
this.checker.inBind = true;
}
if (members) {
this.bind(agg, type.members.allMembers); // REVIEW: Should only be getting exported types?
}
if (typeMembers) {
this.bind(agg, typeMembers.allMembers);
}
if (ambientMembers) {
this.bind(agg, ambientMembers.allMembers);
}
if (ambientTypeMembers) {
this.bind(agg, ambientTypeMembers.allMembers);
}
this.checker.currentModDecl = prevCurrentModDecl;
this.checker.inBind = prevBindStatus;
}
if (type.extendsTypeLinks) {
this.resolveBases(scope, type);
}
if (type.construct) {
this.resolveSignatureGroup(type.construct, scope, instanceType);
}
if (type.call) {
this.resolveSignatureGroup(type.call, scope, null);
}
if (type.index) {
this.resolveSignatureGroup(type.index, scope, null);
}
if (type.elementType) {
this.bindType(scope, type.elementType, null);
}
}
public bindSymbol(scope: SymbolScope, symbol: Symbol) {
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Symbol'.
2014-07-13 01:04:16 +02:00
if (!symbol.bound) {
var prevLocationInfo = this.checker.locationInfo;
if ((this.checker.units) && (symbol.unitIndex >= 0) && (symbol.unitIndex < this.checker.units.length)) {
this.checker.locationInfo = this.checker.units[symbol.unitIndex];
}
switch (symbol.kind()) {
case SymbolKind.Type:
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolKind'.
2014-07-13 01:04:16 +02:00
if (symbol.flags & SymbolFlags.Bound) {
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolFlags'.
2014-07-13 01:04:16 +02:00
break;
}
var typeSymbol = <TypeSymbol>symbol;
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'TypeSymbol'.
2014-07-13 01:04:16 +02:00
typeSymbol.flags |= SymbolFlags.Bound;
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolFlags'.
2014-07-13 01:04:16 +02:00
// Since type collection happens out of order, a dynamic module referenced by an import statement
// may not yet be in scope when the import symbol is created. In that case, we need to search
// out the module symbol now
// Note that we'll also want to do this in resolveTypeMembers, in case the symbol is set outside the
// context of a given module (E.g., an outer import statement)
if (typeSymbol.aliasLink && !typeSymbol.type && typeSymbol.aliasLink.alias.nodeType == NodeType.Name) {
~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'NodeType'.
2014-07-13 01:04:16 +02:00
var modPath = (<Identifier>typeSymbol.aliasLink.alias).text;
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'Identifier'.
2014-07-13 01:04:16 +02:00
var modSym = this.checker.findSymbolForDynamicModule(modPath, this.checker.locationInfo.filename, (id) => scope.find(id, false, true));
if (modSym) {
typeSymbol.type = modSym.getType();
}
}
if (typeSymbol.type && typeSymbol.type != this.checker.gloModType) {
this.bindType(scope, typeSymbol.type, typeSymbol.instanceType);
// bind expansions on the parent type symbol
if (typeSymbol.type.isModuleType()) {
for (var i = 0; i < typeSymbol.expansions.length; i++) {
this.bindType(scope, typeSymbol.expansions[i], typeSymbol.instanceType);
}
}
}
break;
case SymbolKind.Field:
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolKind'.
2014-07-13 01:04:16 +02:00
this.checker.resolveTypeLink(scope, (<FieldSymbol>symbol).field.typeLink,
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'FieldSymbol'.
2014-07-13 01:04:16 +02:00
false);
break;
case SymbolKind.Parameter:
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolKind'.
2014-07-13 01:04:16 +02:00
this.checker.resolveTypeLink(scope,
(<ParameterSymbol>symbol).parameter.typeLink,
~~~~~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'ParameterSymbol'.
2014-07-13 01:04:16 +02:00
true);
break;
}
this.checker.locationInfo = prevLocationInfo;
}
symbol.bound = true;
}
public bind(scope: SymbolScope, table: IHashTable) {
~~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'SymbolScope'.
2014-07-13 01:04:16 +02:00
~~~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2304: Cannot find name 'IHashTable'.
2014-07-13 01:04:16 +02:00
table.map(
(key, sym, binder) => {
binder.bindSymbol(scope, sym);
},
this);
}
}
}