1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
|
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,21): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
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(12,40): error TS1011: An element access expression should take an argument.
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(146,25): error TS2339: Property 'bound' does not exist on type 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(148,53): error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(148,80): error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(149,75): error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(151,32): error TS2339: Property 'kind' does not exist on type 'Symbol'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(152,26): error TS2304: Cannot find name 'SymbolKind'.
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(154,36): error TS2339: Property 'flags' does not exist on type 'Symbol'.
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(197,20): error TS2339: Property 'bound' does not exist on type 'Symbol'.
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'.
==== tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts (39 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' />
~~~~~~~~~~~~~
!!! error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
module TypeScript {
export class Binder {
constructor (public checker: TypeChecker) { }
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'TypeChecker'.
public resolveBaseTypeLinks(typeLinks: TypeLink[], scope: SymbolScope) {
~~~~~~~~
!!! error TS2304: Cannot find name 'TypeLink'.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
var extendsList: Type[] = null;
~~~~
!!! error TS2304: Cannot find name 'Type'.
if (typeLinks) {
extendsList = new Type[];
~~~~
!!! error TS2304: Cannot find name 'Type'.
!!! error TS1011: An element access expression should take an argument.
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) {
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
~~~~
!!! error TS2304: Cannot find name 'Type'.
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) {
~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SignatureGroup'.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
~~~~
!!! error TS2304: Cannot find name 'Type'.
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];
~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ParameterSymbol'.
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 {
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
~~~~
!!! error TS2304: Cannot find name 'Type'.
~~~~
!!! error TS2304: Cannot find name 'Type'.
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);
~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolTableScope'.
var agg = new SymbolAggregateScope(type.symbol);
~~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolAggregateScope'.
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;
~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ModuleDeclaration'.
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) {
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
if (!symbol.bound) {
~~~~~
!!! error TS2339: Property 'bound' does not exist on type 'Symbol'.
var prevLocationInfo = this.checker.locationInfo;
if ((this.checker.units) && (symbol.unitIndex >= 0) && (symbol.unitIndex < this.checker.units.length)) {
~~~~~~~~~
!!! error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
~~~~~~~~~
!!! error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
this.checker.locationInfo = this.checker.units[symbol.unitIndex];
~~~~~~~~~
!!! error TS2339: Property 'unitIndex' does not exist on type 'Symbol'.
}
switch (symbol.kind()) {
~~~~
!!! error TS2339: Property 'kind' does not exist on type 'Symbol'.
case SymbolKind.Type:
~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolKind'.
if (symbol.flags & SymbolFlags.Bound) {
~~~~~
!!! error TS2339: Property 'flags' does not exist on type 'Symbol'.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolFlags'.
break;
}
var typeSymbol = <TypeSymbol>symbol;
~~~~~~~~~~
!!! error TS2304: Cannot find name 'TypeSymbol'.
typeSymbol.flags |= SymbolFlags.Bound;
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolFlags'.
// 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) {
~~~~~~~~
!!! error TS2304: Cannot find name 'NodeType'.
var modPath = (<Identifier>typeSymbol.aliasLink.alias).text;
~~~~~~~~~~
!!! error TS2304: Cannot find name 'Identifier'.
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:
~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolKind'.
this.checker.resolveTypeLink(scope, (<FieldSymbol>symbol).field.typeLink,
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'FieldSymbol'.
false);
break;
case SymbolKind.Parameter:
~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolKind'.
this.checker.resolveTypeLink(scope,
(<ParameterSymbol>symbol).parameter.typeLink,
~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'ParameterSymbol'.
true);
break;
}
this.checker.locationInfo = prevLocationInfo;
}
symbol.bound = true;
~~~~~
!!! error TS2339: Property 'bound' does not exist on type 'Symbol'.
}
public bind(scope: SymbolScope, table: IHashTable) {
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'SymbolScope'.
~~~~~~~~~~
!!! error TS2304: Cannot find name 'IHashTable'.
table.map(
(key, sym, binder) => {
binder.bindSymbol(scope, sym);
},
this);
}
}
}
|