typescript-src 1.0.0.0 → 1.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +2 -0
  3. data/Gemfile +4 -2
  4. data/Rakefile +20 -1
  5. data/lib/typescript-src/support/typescript/.npmignore +12 -0
  6. data/lib/typescript-src/support/typescript/CopyrightNotice.txt +15 -0
  7. data/lib/typescript-src/support/typescript/LICENSE.txt +55 -0
  8. data/lib/typescript-src/support/typescript/README.txt +27 -0
  9. data/lib/typescript-src/support/typescript/ThirdPartyNoticeText.txt +85 -0
  10. data/lib/{support → typescript-src/support/typescript/bin}/lib.d.ts +1 -1
  11. data/lib/{support → typescript-src/support/typescript/bin}/resources/cs/cz/diagnosticMessages.generated.json +0 -0
  12. data/lib/{support → typescript-src/support/typescript/bin}/resources/cs/diagnosticMessages.generated.json +0 -0
  13. data/lib/{support → typescript-src/support/typescript/bin}/resources/cz/diagnosticMessages.generated.json +0 -0
  14. data/lib/{support → typescript-src/support/typescript/bin}/resources/de/diagnosticMessages.generated.json +0 -0
  15. data/lib/{support → typescript-src/support/typescript/bin}/resources/diagnosticMessages.generated.json +0 -0
  16. data/lib/{support → typescript-src/support/typescript/bin}/resources/en/diagnosticMessages.generated.json +0 -0
  17. data/lib/{support → typescript-src/support/typescript/bin}/resources/en/us/diagnosticMessages.generated.json +0 -0
  18. data/lib/{support → typescript-src/support/typescript/bin}/resources/es/diagnosticMessages.generated.json +0 -0
  19. data/lib/{support → typescript-src/support/typescript/bin}/resources/fr/diagnosticMessages.generated.json +0 -0
  20. data/lib/{support → typescript-src/support/typescript/bin}/resources/it/diagnosticMessages.generated.json +0 -0
  21. data/lib/{support → typescript-src/support/typescript/bin}/resources/ja/diagnosticMessages.generated.json +0 -0
  22. data/lib/{support → typescript-src/support/typescript/bin}/resources/ja/jp/diagnosticMessages.generated.json +0 -0
  23. data/lib/{support → typescript-src/support/typescript/bin}/resources/ko/diagnosticMessages.generated.json +0 -0
  24. data/lib/{support → typescript-src/support/typescript/bin}/resources/ko/kr/diagnosticMessages.generated.json +0 -0
  25. data/lib/{support → typescript-src/support/typescript/bin}/resources/pl/diagnosticMessages.generated.json +0 -0
  26. data/lib/{support → typescript-src/support/typescript/bin}/resources/pt/br/diagnosticMessages.generated.json +0 -0
  27. data/lib/{support → typescript-src/support/typescript/bin}/resources/pt/diagnosticMessages.generated.json +0 -0
  28. data/lib/{support → typescript-src/support/typescript/bin}/resources/ru/diagnosticMessages.generated.json +0 -0
  29. data/lib/{support → typescript-src/support/typescript/bin}/resources/tr/diagnosticMessages.generated.json +0 -0
  30. data/lib/{support → typescript-src/support/typescript/bin}/resources/zh/cn/diagnosticMessages.generated.json +0 -0
  31. data/lib/{support → typescript-src/support/typescript/bin}/resources/zh/tw/diagnosticMessages.generated.json +0 -0
  32. data/lib/{support → typescript-src/support/typescript/bin}/tsc +0 -0
  33. data/lib/{support → typescript-src/support/typescript/bin}/tsc.js +294 -154
  34. data/lib/{support → typescript-src/support/typescript/bin}/typescript.js +289 -152
  35. data/lib/typescript-src/support/typescript/package.json +61 -0
  36. data/lib/typescript-src.rb +37 -5
  37. data/test/test_type_script_src.rb +31 -0
  38. data/typescript-src.gemspec +20 -10
  39. metadata +60 -37
@@ -28167,6 +28167,11 @@ var TypeScript;
28167
28167
  }
28168
28168
  ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName;
28169
28169
 
28170
+ function parentIsModuleDeclaration(ast) {
28171
+ return ast.parent && ast.parent.kind() === 130 /* ModuleDeclaration */;
28172
+ }
28173
+ ASTHelpers.parentIsModuleDeclaration = parentIsModuleDeclaration;
28174
+
28170
28175
  function parametersFromIdentifier(id) {
28171
28176
  return {
28172
28177
  length: 1,
@@ -28448,37 +28453,55 @@ var TypeScript;
28448
28453
  }
28449
28454
  ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration;
28450
28455
 
28451
- function isLastNameOfModule(ast, astName) {
28456
+ function isEntireNameOfModuleDeclaration(nameAST) {
28457
+ return parentIsModuleDeclaration(nameAST) && nameAST.parent.name === nameAST;
28458
+ }
28459
+
28460
+ function getModuleDeclarationFromNameAST(ast) {
28452
28461
  if (ast) {
28453
- if (ast.stringLiteral) {
28454
- return astName === ast.stringLiteral;
28455
- } else {
28456
- var moduleNames = getModuleNames(ast.name);
28457
- var nameIndex = moduleNames.indexOf(astName);
28462
+ switch (ast.kind()) {
28463
+ case 14 /* StringLiteral */:
28464
+ if (parentIsModuleDeclaration(ast) && ast.parent.stringLiteral === ast) {
28465
+ return ast.parent;
28466
+ }
28467
+ return null;
28468
+
28469
+ case 11 /* IdentifierName */:
28470
+ case 121 /* QualifiedName */:
28471
+ if (isEntireNameOfModuleDeclaration(ast)) {
28472
+ return ast.parent;
28473
+ }
28474
+ break;
28475
+
28476
+ default:
28477
+ return null;
28478
+ }
28458
28479
 
28459
- return nameIndex === (moduleNames.length - 1);
28480
+ for (ast = ast.parent; ast && ast.kind() === 121 /* QualifiedName */; ast = ast.parent) {
28481
+ if (isEntireNameOfModuleDeclaration(ast)) {
28482
+ return ast.parent;
28483
+ }
28460
28484
  }
28461
28485
  }
28462
28486
 
28463
- return false;
28487
+ return null;
28464
28488
  }
28465
- ASTHelpers.isLastNameOfModule = isLastNameOfModule;
28489
+ ASTHelpers.getModuleDeclarationFromNameAST = getModuleDeclarationFromNameAST;
28466
28490
 
28467
- function isAnyNameOfModule(ast, astName) {
28491
+ function isLastNameOfModule(ast, astName) {
28468
28492
  if (ast) {
28469
28493
  if (ast.stringLiteral) {
28470
- return ast.stringLiteral === astName;
28494
+ return astName === ast.stringLiteral;
28495
+ } else if (ast.name.kind() === 121 /* QualifiedName */) {
28496
+ return astName === ast.name.right;
28471
28497
  } else {
28472
- var moduleNames = getModuleNames(ast.name);
28473
- var nameIndex = moduleNames.indexOf(astName);
28474
-
28475
- return nameIndex >= 0;
28498
+ return astName === ast.name;
28476
28499
  }
28477
28500
  }
28478
28501
 
28479
28502
  return false;
28480
28503
  }
28481
- ASTHelpers.isAnyNameOfModule = isAnyNameOfModule;
28504
+ ASTHelpers.isLastNameOfModule = isLastNameOfModule;
28482
28505
 
28483
28506
  function getNameOfIdenfierOrQualifiedName(name) {
28484
28507
  if (name.kind() === 11 /* IdentifierName */) {
@@ -31947,7 +31970,42 @@ var TypeScript;
31947
31970
  };
31948
31971
 
31949
31972
  Emitter.prototype.emitParenthesizedExpression = function (parenthesizedExpression) {
31973
+ var omitParentheses = false;
31974
+
31950
31975
  if (parenthesizedExpression.expression.kind() === 220 /* CastExpression */ && parenthesizedExpression.openParenTrailingComments === null) {
31976
+ var castedExpression = parenthesizedExpression.expression.expression;
31977
+
31978
+ while (castedExpression.kind() == 220 /* CastExpression */) {
31979
+ castedExpression = castedExpression.expression;
31980
+ }
31981
+
31982
+ switch (castedExpression.kind()) {
31983
+ case 217 /* ParenthesizedExpression */:
31984
+ case 11 /* IdentifierName */:
31985
+ case 32 /* NullKeyword */:
31986
+ case 35 /* ThisKeyword */:
31987
+ case 14 /* StringLiteral */:
31988
+ case 13 /* NumericLiteral */:
31989
+ case 12 /* RegularExpressionLiteral */:
31990
+ case 37 /* TrueKeyword */:
31991
+ case 24 /* FalseKeyword */:
31992
+ case 214 /* ArrayLiteralExpression */:
31993
+ case 215 /* ObjectLiteralExpression */:
31994
+ case 212 /* MemberAccessExpression */:
31995
+ case 221 /* ElementAccessExpression */:
31996
+ omitParentheses = true;
31997
+ break;
31998
+
31999
+ case 213 /* InvocationExpression */:
32000
+ if (parenthesizedExpression.parent.kind() !== 216 /* ObjectCreationExpression */) {
32001
+ omitParentheses = true;
32002
+ }
32003
+
32004
+ break;
32005
+ }
32006
+ }
32007
+
32008
+ if (omitParentheses) {
31951
32009
  this.emit(parenthesizedExpression.expression);
31952
32010
  } else {
31953
32011
  this.recordSourceMappingStart(parenthesizedExpression);
@@ -34314,10 +34372,8 @@ var TypeScript;
34314
34372
  };
34315
34373
 
34316
34374
  DeclarationEmitter.getEnclosingContainer = function (ast) {
34317
- var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast);
34318
- if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, ast)) {
34319
- ast = enclosingModule;
34320
- }
34375
+ var enclosingModule = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(ast);
34376
+ ast = enclosingModule || ast;
34321
34377
 
34322
34378
  ast = ast.parent;
34323
34379
  while (ast) {
@@ -35409,7 +35465,7 @@ var TypeScript;
35409
35465
  return false;
35410
35466
  };
35411
35467
 
35412
- PullSymbol.prototype.findAliasedType = function (scopeSymbol, skipScopeSymbolAliasesLookIn, lookIntoOnlyExportedAlias, aliasSymbols, visitedScopeDeclarations) {
35468
+ PullSymbol.prototype.findAliasedTypeSymbols = function (scopeSymbol, skipScopeSymbolAliasesLookIn, lookIntoOnlyExportedAlias, aliasSymbols, visitedScopeDeclarations) {
35413
35469
  if (typeof aliasSymbols === "undefined") { aliasSymbols = []; }
35414
35470
  if (typeof visitedScopeDeclarations === "undefined") { visitedScopeDeclarations = []; }
35415
35471
  var scopeDeclarations = scopeSymbol.getDeclarations();
@@ -35443,7 +35499,7 @@ var TypeScript;
35443
35499
  var scopeSymbolAlias = scopeSymbolAliasesToLookIn[i];
35444
35500
 
35445
35501
  aliasSymbols.push(scopeSymbolAlias);
35446
- var result = this.findAliasedType(scopeSymbolAlias.assignedContainer().hasExportAssignment() ? scopeSymbolAlias.assignedContainer().getExportAssignedContainerSymbol() : scopeSymbolAlias.assignedContainer(), false, true, aliasSymbols, visitedScopeDeclarations);
35502
+ var result = this.findAliasedTypeSymbols(scopeSymbolAlias.assignedContainer().hasExportAssignment() ? scopeSymbolAlias.assignedContainer().getExportAssignedContainerSymbol() : scopeSymbolAlias.assignedContainer(), false, true, aliasSymbols, visitedScopeDeclarations);
35447
35503
  if (result) {
35448
35504
  return result;
35449
35505
  }
@@ -35461,7 +35517,7 @@ var TypeScript;
35461
35517
 
35462
35518
  var scopePath = scopeSymbol.pathToRoot();
35463
35519
  if (scopePath.length && scopePath[scopePath.length - 1].kind === 32 /* DynamicModule */) {
35464
- var symbols = this.findAliasedType(scopePath[scopePath.length - 1]);
35520
+ var symbols = this.findAliasedTypeSymbols(scopePath[scopePath.length - 1]);
35465
35521
  return symbols;
35466
35522
  }
35467
35523
 
@@ -35493,7 +35549,7 @@ var TypeScript;
35493
35549
  if (this.kind !== 128 /* TypeAlias */) {
35494
35550
  var scopePath = scopeSymbol.pathToRoot();
35495
35551
  for (var i = 0; i < scopePath.length; i++) {
35496
- var internalAliases = this.findAliasedType(scopeSymbol, true, true);
35552
+ var internalAliases = this.findAliasedTypeSymbols(scopeSymbol, true, true);
35497
35553
  if (internalAliases) {
35498
35554
  TypeScript.Debug.assert(internalAliases.length === 1);
35499
35555
  return internalAliases[0];
@@ -35515,7 +35571,7 @@ var TypeScript;
35515
35571
 
35516
35572
  var externalAliases = this.getExternalAliasedSymbols(scopeSymbol);
35517
35573
 
35518
- if (externalAliases && PullSymbol._isExternalModuleReferenceAlias(externalAliases[externalAliases.length - 1])) {
35574
+ if (externalAliases && externalAliases[0] != this && PullSymbol._isExternalModuleReferenceAlias(externalAliases[externalAliases.length - 1])) {
35519
35575
  var aliasFullName = aliasNameGetter(externalAliases[0]);
35520
35576
  if (!aliasFullName) {
35521
35577
  return null;
@@ -36041,7 +36097,7 @@ var TypeScript;
36041
36097
  var ast = decl.ast();
36042
36098
 
36043
36099
  if (ast) {
36044
- var enclosingModuleDeclaration = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast);
36100
+ var enclosingModuleDeclaration = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(ast);
36045
36101
  if (TypeScript.ASTHelpers.isLastNameOfModule(enclosingModuleDeclaration, ast)) {
36046
36102
  return TypeScript.ASTHelpers.docComments(enclosingModuleDeclaration);
36047
36103
  }
@@ -37443,6 +37499,8 @@ var TypeScript;
37443
37499
  var signatures = [];
37444
37500
  for (var i = 0; i < baseConstructSignatures.length; i++) {
37445
37501
  var baseSignature = baseConstructSignatures[i];
37502
+
37503
+ baseSignature._resolveDeclaredSymbol();
37446
37504
  var currentSignature = new PullSignatureSymbol(2097152 /* ConstructSignature */, baseSignature.isDefinition());
37447
37505
  currentSignature.returnType = instanceTypeSymbol;
37448
37506
  currentSignature.addTypeParametersFromReturnType();
@@ -38206,7 +38264,13 @@ var TypeScript;
38206
38264
  var typeExportSymbol = moduleSymbol.getExportAssignedTypeSymbol();
38207
38265
  var containerExportSymbol = moduleSymbol.getExportAssignedContainerSymbol();
38208
38266
  if (valueExportSymbol || typeExportSymbol || containerExportSymbol) {
38209
- return valueExportSymbol === symbol || typeExportSymbol == symbol || containerExportSymbol == symbol || PullContainerSymbol.usedAsSymbol(containerExportSymbol, symbol);
38267
+ if (valueExportSymbol === symbol || typeExportSymbol == symbol || containerExportSymbol == symbol) {
38268
+ return true;
38269
+ }
38270
+
38271
+ if (containerExportSymbol != containerSymbol) {
38272
+ return PullContainerSymbol.usedAsSymbol(containerExportSymbol, symbol);
38273
+ }
38210
38274
  }
38211
38275
 
38212
38276
  return false;
@@ -38696,13 +38760,60 @@ var TypeScript;
38696
38760
  })(TypeScript || (TypeScript = {}));
38697
38761
  var TypeScript;
38698
38762
  (function (TypeScript) {
38763
+ var EnclosingTypeWalkerState = (function () {
38764
+ function EnclosingTypeWalkerState() {
38765
+ }
38766
+ EnclosingTypeWalkerState.getDefaultEnclosingTypeWalkerState = function () {
38767
+ var defaultEnclosingTypeWalkerState = new EnclosingTypeWalkerState();
38768
+ defaultEnclosingTypeWalkerState._hasSetEnclosingType = false;
38769
+ return defaultEnclosingTypeWalkerState;
38770
+ };
38771
+
38772
+ EnclosingTypeWalkerState.getNonGenericEnclosingTypeWalkerState = function () {
38773
+ var defaultEnclosingTypeWalkerState = new EnclosingTypeWalkerState();
38774
+ defaultEnclosingTypeWalkerState._hasSetEnclosingType = true;
38775
+ return defaultEnclosingTypeWalkerState;
38776
+ };
38777
+
38778
+ EnclosingTypeWalkerState.getGenericEnclosingTypeWalkerState = function (genericEnclosingType) {
38779
+ var defaultEnclosingTypeWalkerState = new EnclosingTypeWalkerState();
38780
+ defaultEnclosingTypeWalkerState._hasSetEnclosingType = true;
38781
+ defaultEnclosingTypeWalkerState._currentSymbols = [TypeScript.PullHelpers.getRootType(genericEnclosingType)];
38782
+ return defaultEnclosingTypeWalkerState;
38783
+ };
38784
+ return EnclosingTypeWalkerState;
38785
+ })();
38786
+ TypeScript.EnclosingTypeWalkerState = EnclosingTypeWalkerState;
38787
+
38699
38788
  var PullTypeEnclosingTypeWalker = (function () {
38700
38789
  function PullTypeEnclosingTypeWalker() {
38701
- this.currentSymbols = null;
38790
+ this.setDefaultTypeWalkerState();
38702
38791
  }
38792
+ PullTypeEnclosingTypeWalker.prototype.setDefaultTypeWalkerState = function () {
38793
+ this.enclosingTypeWalkerState = PullTypeEnclosingTypeWalker._defaultEnclosingTypeWalkerState;
38794
+ };
38795
+
38796
+ PullTypeEnclosingTypeWalker.prototype.setNonGenericEnclosingTypeWalkerState = function () {
38797
+ this.enclosingTypeWalkerState = PullTypeEnclosingTypeWalker._nonGenericEnclosingTypeWalkerState;
38798
+ };
38799
+
38800
+ PullTypeEnclosingTypeWalker.prototype.canSymbolOrDeclBeUsedAsEnclosingTypeHelper = function (name, kind) {
38801
+ return name && (kind === 8 /* Class */ || kind === 16 /* Interface */);
38802
+ };
38803
+
38804
+ PullTypeEnclosingTypeWalker.prototype.canDeclBeUsedAsEnclosingType = function (decl) {
38805
+ return this.canSymbolOrDeclBeUsedAsEnclosingTypeHelper(decl.name, decl.kind);
38806
+ };
38807
+
38808
+ PullTypeEnclosingTypeWalker.prototype.canSymbolBeUsedAsEnclosingType = function (symbol) {
38809
+ return this.canSymbolOrDeclBeUsedAsEnclosingTypeHelper(symbol.name, symbol.kind);
38810
+ };
38811
+
38703
38812
  PullTypeEnclosingTypeWalker.prototype.getEnclosingType = function () {
38704
- if (this.currentSymbols && this.currentSymbols.length > 0) {
38705
- return this.currentSymbols[0];
38813
+ var currentSymbols = this.enclosingTypeWalkerState._currentSymbols;
38814
+ if (currentSymbols) {
38815
+ TypeScript.Debug.assert(currentSymbols.length > 0);
38816
+ return currentSymbols[0];
38706
38817
  }
38707
38818
 
38708
38819
  return null;
@@ -38710,12 +38821,14 @@ var TypeScript;
38710
38821
 
38711
38822
  PullTypeEnclosingTypeWalker.prototype._canWalkStructure = function () {
38712
38823
  var enclosingType = this.getEnclosingType();
38713
- return !!enclosingType && enclosingType.isGeneric();
38824
+ TypeScript.Debug.assert(!enclosingType || enclosingType.isGeneric());
38825
+ return !!enclosingType;
38714
38826
  };
38715
38827
 
38716
38828
  PullTypeEnclosingTypeWalker.prototype._getCurrentSymbol = function () {
38717
- if (this.currentSymbols && this.currentSymbols.length) {
38718
- return this.currentSymbols[this.currentSymbols.length - 1];
38829
+ var currentSymbols = this.enclosingTypeWalkerState._currentSymbols;
38830
+ if (currentSymbols && currentSymbols.length) {
38831
+ return currentSymbols[currentSymbols.length - 1];
38719
38832
  }
38720
38833
 
38721
38834
  return null;
@@ -38723,7 +38836,7 @@ var TypeScript;
38723
38836
 
38724
38837
  PullTypeEnclosingTypeWalker.prototype.getGenerativeClassification = function () {
38725
38838
  if (this._canWalkStructure()) {
38726
- var currentType = this.currentSymbols[this.currentSymbols.length - 1];
38839
+ var currentType = this._getCurrentSymbol();
38727
38840
  if (!currentType) {
38728
38841
  return 0 /* Unknown */;
38729
38842
  }
@@ -38737,18 +38850,27 @@ var TypeScript;
38737
38850
  };
38738
38851
 
38739
38852
  PullTypeEnclosingTypeWalker.prototype._pushSymbol = function (symbol) {
38740
- return this.currentSymbols.push(symbol);
38853
+ return this.enclosingTypeWalkerState._currentSymbols.push(symbol);
38741
38854
  };
38742
38855
 
38743
38856
  PullTypeEnclosingTypeWalker.prototype._popSymbol = function () {
38744
- return this.currentSymbols.pop();
38857
+ return this.enclosingTypeWalkerState._currentSymbols.pop();
38858
+ };
38859
+
38860
+ PullTypeEnclosingTypeWalker.prototype.setSymbolAsEnclosingType = function (type) {
38861
+ if (type.isGeneric()) {
38862
+ this.enclosingTypeWalkerState = EnclosingTypeWalkerState.getGenericEnclosingTypeWalkerState(type);
38863
+ } else {
38864
+ this.setNonGenericEnclosingTypeWalkerState();
38865
+ }
38745
38866
  };
38746
38867
 
38747
38868
  PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeOfParentDecl = function (decl, setSignature) {
38748
38869
  var parentDecl = decl.getParentDecl();
38749
- if (parentDecl) {
38750
- if (parentDecl.kind & 8216 /* SomeInstantiatableType */) {
38751
- this._setEnclosingTypeWorker(parentDecl.getSymbol(), true);
38870
+
38871
+ if (parentDecl && !(parentDecl.kind & (164 /* SomeContainer */ | 1 /* Script */))) {
38872
+ if (this.canDeclBeUsedAsEnclosingType(parentDecl)) {
38873
+ this.setSymbolAsEnclosingType(parentDecl.getSymbol());
38752
38874
  } else {
38753
38875
  this._setEnclosingTypeOfParentDecl(parentDecl, true);
38754
38876
  }
@@ -38773,45 +38895,42 @@ var TypeScript;
38773
38895
  }
38774
38896
  };
38775
38897
 
38776
- PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeWorker = function (symbol, setSignature) {
38777
- if (symbol.isType() && symbol.isNamedTypeSymbol()) {
38778
- this.currentSymbols = [TypeScript.PullHelpers.getRootType(symbol)];
38779
- return;
38780
- }
38898
+ PullTypeEnclosingTypeWalker.prototype.setEnclosingTypeForSymbol = function (symbol) {
38899
+ var currentEnclosingTypeWalkerState = this.enclosingTypeWalkerState;
38900
+ if (this.canSymbolBeUsedAsEnclosingType(symbol)) {
38901
+ this.setSymbolAsEnclosingType(symbol);
38902
+ } else {
38903
+ this.setDefaultTypeWalkerState();
38781
38904
 
38782
- var decls = symbol.getDeclarations();
38783
- for (var i = 0; i < decls.length; i++) {
38784
- var decl = decls[i];
38785
- this._setEnclosingTypeOfParentDecl(decl, setSignature);
38786
- if (this._canWalkStructure()) {
38787
- return;
38905
+ var decls = symbol.getDeclarations();
38906
+ for (var i = 0; i < decls.length; i++) {
38907
+ var decl = decls[i];
38908
+ this._setEnclosingTypeOfParentDecl(decl, symbol.isSignature());
38909
+
38910
+ if (this.enclosingTypeWalkerState._hasSetEnclosingType) {
38911
+ break;
38912
+ }
38788
38913
  }
38789
- }
38790
- };
38791
38914
 
38792
- PullTypeEnclosingTypeWalker.prototype.setCurrentSymbol = function (symbol) {
38793
- TypeScript.Debug.assert(this._canWalkStructure());
38794
- this.currentSymbols[this.currentSymbols.length - 1] = symbol;
38915
+ if (!this.enclosingTypeWalkerState._hasSetEnclosingType) {
38916
+ this.setNonGenericEnclosingTypeWalkerState();
38917
+ }
38918
+ }
38919
+ return currentEnclosingTypeWalkerState;
38795
38920
  };
38796
38921
 
38797
38922
  PullTypeEnclosingTypeWalker.prototype.startWalkingType = function (symbol) {
38798
- var currentSymbols = this.currentSymbols;
38923
+ var currentState = this.enclosingTypeWalkerState;
38799
38924
 
38800
- var setEnclosingType = !this.getEnclosingType() || symbol.isNamedTypeSymbol();
38801
- if (setEnclosingType) {
38802
- this.currentSymbols = null;
38803
- this.setEnclosingType(symbol);
38925
+ var setEnclosingTypeForSymbol = !this.enclosingTypeWalkerState._hasSetEnclosingType || this.canSymbolBeUsedAsEnclosingType(symbol);
38926
+ if (setEnclosingTypeForSymbol) {
38927
+ this.setEnclosingTypeForSymbol(symbol);
38804
38928
  }
38805
- return currentSymbols;
38929
+ return currentState;
38806
38930
  };
38807
38931
 
38808
- PullTypeEnclosingTypeWalker.prototype.endWalkingType = function (currentSymbolsWhenStartedWalkingTypes) {
38809
- this.currentSymbols = currentSymbolsWhenStartedWalkingTypes;
38810
- };
38811
-
38812
- PullTypeEnclosingTypeWalker.prototype.setEnclosingType = function (symbol) {
38813
- TypeScript.Debug.assert(!this.getEnclosingType());
38814
- this._setEnclosingTypeWorker(symbol, symbol.isSignature());
38932
+ PullTypeEnclosingTypeWalker.prototype.endWalkingType = function (stateWhenStartedWalkingTypes) {
38933
+ this.enclosingTypeWalkerState = stateWhenStartedWalkingTypes;
38815
38934
  };
38816
38935
 
38817
38936
  PullTypeEnclosingTypeWalker.prototype.walkMemberType = function (memberName, resolver) {
@@ -38945,6 +39064,23 @@ var TypeScript;
38945
39064
  this._popSymbol();
38946
39065
  }
38947
39066
  };
39067
+
39068
+ PullTypeEnclosingTypeWalker.prototype.resetEnclosingTypeWalkerState = function () {
39069
+ var currentState = this.enclosingTypeWalkerState;
39070
+ this.setDefaultTypeWalkerState();
39071
+ return currentState;
39072
+ };
39073
+
39074
+ PullTypeEnclosingTypeWalker.prototype.setEnclosingTypeWalkerState = function (enclosingTypeWalkerState) {
39075
+ if (enclosingTypeWalkerState) {
39076
+ this.enclosingTypeWalkerState = enclosingTypeWalkerState;
39077
+ } else {
39078
+ this.setDefaultTypeWalkerState();
39079
+ }
39080
+ };
39081
+ PullTypeEnclosingTypeWalker._defaultEnclosingTypeWalkerState = EnclosingTypeWalkerState.getDefaultEnclosingTypeWalkerState();
39082
+
39083
+ PullTypeEnclosingTypeWalker._nonGenericEnclosingTypeWalkerState = EnclosingTypeWalkerState.getNonGenericEnclosingTypeWalkerState();
38948
39084
  return PullTypeEnclosingTypeWalker;
38949
39085
  })();
38950
39086
  TypeScript.PullTypeEnclosingTypeWalker = PullTypeEnclosingTypeWalker;
@@ -39341,28 +39477,35 @@ var TypeScript;
39341
39477
  if (!this.enclosingTypeWalker1) {
39342
39478
  this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker();
39343
39479
  }
39344
- var symbolsWhenStartedWalkingTypes1 = this.enclosingTypeWalker1.startWalkingType(symbol1);
39480
+ var stateWhenStartedWalkingTypes1 = this.enclosingTypeWalker1.startWalkingType(symbol1);
39345
39481
  if (!this.enclosingTypeWalker2) {
39346
39482
  this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker();
39347
39483
  }
39348
- var symbolsWhenStartedWalkingTypes2 = this.enclosingTypeWalker2.startWalkingType(symbol2);
39349
- return { symbolsWhenStartedWalkingTypes1: symbolsWhenStartedWalkingTypes1, symbolsWhenStartedWalkingTypes2: symbolsWhenStartedWalkingTypes2 };
39484
+ var stateWhenStartedWalkingTypes2 = this.enclosingTypeWalker2.startWalkingType(symbol2);
39485
+ return {
39486
+ stateWhenStartedWalkingTypes1: stateWhenStartedWalkingTypes1,
39487
+ stateWhenStartedWalkingTypes2: stateWhenStartedWalkingTypes2
39488
+ };
39350
39489
  };
39351
39490
 
39352
- PullTypeResolutionContext.prototype.endWalkingTypes = function (symbolsWhenStartedWalkingTypes) {
39353
- this.enclosingTypeWalker1.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes1);
39354
- this.enclosingTypeWalker2.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes2);
39491
+ PullTypeResolutionContext.prototype.endWalkingTypes = function (statesWhenStartedWalkingTypes) {
39492
+ this.enclosingTypeWalker1.endWalkingType(statesWhenStartedWalkingTypes.stateWhenStartedWalkingTypes1);
39493
+ this.enclosingTypeWalker2.endWalkingType(statesWhenStartedWalkingTypes.stateWhenStartedWalkingTypes2);
39355
39494
  };
39356
39495
 
39357
- PullTypeResolutionContext.prototype.setEnclosingTypes = function (symbol1, symbol2) {
39496
+ PullTypeResolutionContext.prototype.setEnclosingTypeForSymbols = function (symbol1, symbol2) {
39358
39497
  if (!this.enclosingTypeWalker1) {
39359
39498
  this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker();
39360
39499
  }
39361
- this.enclosingTypeWalker1.setEnclosingType(symbol1);
39500
+ var enclosingTypeWalkerState1 = this.enclosingTypeWalker1.setEnclosingTypeForSymbol(symbol1);
39362
39501
  if (!this.enclosingTypeWalker2) {
39363
39502
  this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker();
39364
39503
  }
39365
- this.enclosingTypeWalker2.setEnclosingType(symbol2);
39504
+ var enclosingTypeWalkerState2 = this.enclosingTypeWalker2.setEnclosingTypeForSymbol(symbol2);
39505
+ return {
39506
+ enclosingTypeWalkerState1: enclosingTypeWalkerState1,
39507
+ enclosingTypeWalkerState2: enclosingTypeWalkerState2
39508
+ };
39366
39509
  };
39367
39510
 
39368
39511
  PullTypeResolutionContext.prototype.walkMemberTypes = function (memberName) {
@@ -39460,20 +39603,24 @@ var TypeScript;
39460
39603
  return false;
39461
39604
  };
39462
39605
 
39463
- PullTypeResolutionContext.prototype.resetEnclosingTypeWalkers = function () {
39464
- var enclosingTypeWalker1 = this.enclosingTypeWalker1;
39465
- var enclosingTypeWalker2 = this.enclosingTypeWalker2;
39466
- this.enclosingTypeWalker1 = null;
39467
- this.enclosingTypeWalker2 = null;
39606
+ PullTypeResolutionContext.prototype.resetEnclosingTypeWalkerStates = function () {
39607
+ var enclosingTypeWalkerState1 = this.enclosingTypeWalker1 ? this.enclosingTypeWalker1.resetEnclosingTypeWalkerState() : null;
39608
+ var enclosingTypeWalkerState2 = this.enclosingTypeWalker2 ? this.enclosingTypeWalker2.resetEnclosingTypeWalkerState() : null;
39468
39609
  return {
39469
- enclosingTypeWalker1: enclosingTypeWalker1,
39470
- enclosingTypeWalker2: enclosingTypeWalker2
39610
+ enclosingTypeWalkerState1: enclosingTypeWalkerState1,
39611
+ enclosingTypeWalkerState2: enclosingTypeWalkerState2
39471
39612
  };
39472
39613
  };
39473
39614
 
39474
- PullTypeResolutionContext.prototype.setEnclosingTypeWalkers = function (enclosingTypeWalkers) {
39475
- this.enclosingTypeWalker1 = enclosingTypeWalkers.enclosingTypeWalker1;
39476
- this.enclosingTypeWalker2 = enclosingTypeWalkers.enclosingTypeWalker2;
39615
+ PullTypeResolutionContext.prototype.setEnclosingTypeWalkerStates = function (enclosingTypeWalkerStates) {
39616
+ TypeScript.Debug.assert(this.enclosingTypeWalker1 || !enclosingTypeWalkerStates.enclosingTypeWalkerState1);
39617
+ if (this.enclosingTypeWalker1) {
39618
+ this.enclosingTypeWalker1.setEnclosingTypeWalkerState(enclosingTypeWalkerStates.enclosingTypeWalkerState1);
39619
+ }
39620
+ TypeScript.Debug.assert(this.enclosingTypeWalker2 || !enclosingTypeWalkerStates.enclosingTypeWalkerState2);
39621
+ if (this.enclosingTypeWalker2) {
39622
+ this.enclosingTypeWalker2.setEnclosingTypeWalkerState(enclosingTypeWalkerStates.enclosingTypeWalkerState2);
39623
+ }
39477
39624
  };
39478
39625
  return PullTypeResolutionContext;
39479
39626
  })();
@@ -40328,9 +40475,9 @@ var TypeScript;
40328
40475
  return symbol;
40329
40476
  }
40330
40477
 
40331
- var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast);
40478
+ var enclosingModule = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(ast);
40332
40479
  var resolvedSymbol;
40333
- if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, ast)) {
40480
+ if (enclosingModule) {
40334
40481
  resolvedSymbol = this.resolveSingleModuleDeclaration(enclosingModule, ast, context);
40335
40482
  } else if (ast.kind() === 120 /* SourceUnit */ && decl.kind === 32 /* DynamicModule */) {
40336
40483
  resolvedSymbol = this.resolveModuleSymbol(decl.getSymbol(), context, null, null, ast);
@@ -40345,13 +40492,19 @@ var TypeScript;
40345
40492
  }
40346
40493
  }
40347
40494
 
40495
+ if (!symbol.isResolved) {
40496
+ TypeScript.Debug.assert(!symbol.inResolution);
40497
+
40498
+ symbol.setResolved();
40499
+ }
40500
+
40348
40501
  return symbol;
40349
40502
  };
40350
40503
 
40351
40504
  PullTypeResolver.prototype.resolveOtherDecl = function (otherDecl, context) {
40352
40505
  var astForOtherDecl = this.getASTForDecl(otherDecl);
40353
- var moduleDecl = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(astForOtherDecl);
40354
- if (TypeScript.ASTHelpers.isAnyNameOfModule(moduleDecl, astForOtherDecl)) {
40506
+ var moduleDecl = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(astForOtherDecl);
40507
+ if (moduleDecl) {
40355
40508
  this.resolveSingleModuleDeclaration(moduleDecl, astForOtherDecl, context);
40356
40509
  } else {
40357
40510
  this.resolveAST(astForOtherDecl, false, context);
@@ -40666,8 +40819,11 @@ var TypeScript;
40666
40819
  if (enclosingDecl.kind === 1 /* Script */ && declGroups[i].length) {
40667
40820
  var name = declGroups[i][0].name;
40668
40821
  var candidateSymbol = this.semanticInfoChain.findTopLevelSymbol(name, 512 /* Variable */, enclosingDecl);
40669
- if (candidateSymbol && candidateSymbol.isResolved) {
40822
+ if (candidateSymbol) {
40670
40823
  if (!candidateSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */)) {
40824
+ if (!candidateSymbol.isResolved) {
40825
+ this.resolveDeclaredSymbol(candidateSymbol);
40826
+ }
40671
40827
  firstSymbol = candidateSymbol;
40672
40828
  }
40673
40829
  }
@@ -41740,8 +41896,8 @@ var TypeScript;
41740
41896
  PullTypeResolver.prototype.checkExternalModuleRequireExportsCollides = function (ast, name, context) {
41741
41897
  var enclosingDecl = this.getEnclosingDeclForAST(ast);
41742
41898
 
41743
- var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(name);
41744
- if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, name)) {
41899
+ var enclosingModule = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(name);
41900
+ if (enclosingModule) {
41745
41901
  enclosingDecl = this.getEnclosingDeclForAST(enclosingModule);
41746
41902
  }
41747
41903
 
@@ -42365,8 +42521,8 @@ var TypeScript;
42365
42521
 
42366
42522
  var enclosingDecl = this.getEnclosingDeclForAST(_thisAST);
42367
42523
 
42368
- var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(_thisAST);
42369
- if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, _thisAST)) {
42524
+ var enclosingModule = TypeScript.ASTHelpers.getModuleDeclarationFromNameAST(_thisAST);
42525
+ if (enclosingModule) {
42370
42526
  enclosingDecl = this.getEnclosingDeclForAST(enclosingModule);
42371
42527
  }
42372
42528
 
@@ -47564,9 +47720,9 @@ var TypeScript;
47564
47720
  };
47565
47721
 
47566
47722
  PullTypeResolver.prototype.typesAreIdenticalWithNewEnclosingTypes = function (t1, t2, context) {
47567
- var enclosingTypeWalkers = context.resetEnclosingTypeWalkers();
47723
+ var enclosingTypeWalkerStates = context.resetEnclosingTypeWalkerStates();
47568
47724
  var areTypesIdentical = this.typesAreIdentical(t1, t2, context);
47569
- context.setEnclosingTypeWalkers(enclosingTypeWalkers);
47725
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47570
47726
  return areTypesIdentical;
47571
47727
  };
47572
47728
 
@@ -47621,9 +47777,9 @@ var TypeScript;
47621
47777
  }
47622
47778
 
47623
47779
  this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, true);
47624
- var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(t1, t2);
47780
+ var statesWhenStartedWalkingTypes = context.startWalkingTypes(t1, t2);
47625
47781
  isIdentical = this.typesAreIdenticalWorker(t1, t2, context);
47626
- context.endWalkingTypes(symbolsWhenStartedWalkingTypes);
47782
+ context.endWalkingTypes(statesWhenStartedWalkingTypes);
47627
47783
  this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, isIdentical);
47628
47784
 
47629
47785
  return isIdentical;
@@ -47725,10 +47881,9 @@ var TypeScript;
47725
47881
  };
47726
47882
 
47727
47883
  PullTypeResolver.prototype.propertiesAreIdenticalWithNewEnclosingTypes = function (type1, type2, property1, property2, context) {
47728
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47729
- context.setEnclosingTypes(type1, type2);
47884
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(type1, type2);
47730
47885
  var arePropertiesIdentical = this.propertiesAreIdentical(property1, property2, context);
47731
- context.setEnclosingTypeWalkers(enclosingWalkers);
47886
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47732
47887
  return arePropertiesIdentical;
47733
47888
  };
47734
47889
 
@@ -47798,10 +47953,9 @@ var TypeScript;
47798
47953
 
47799
47954
  PullTypeResolver.prototype.signaturesAreIdenticalWithNewEnclosingTypes = function (s1, s2, context, includingReturnType) {
47800
47955
  if (typeof includingReturnType === "undefined") { includingReturnType = true; }
47801
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47802
- context.setEnclosingTypes(s1, s2);
47956
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(s1, s2);
47803
47957
  var areSignaturesIdentical = this.signaturesAreIdentical(s1, s2, context, includingReturnType);
47804
- context.setEnclosingTypeWalkers(enclosingWalkers);
47958
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47805
47959
  return areSignaturesIdentical;
47806
47960
  };
47807
47961
 
@@ -47893,12 +48047,11 @@ var TypeScript;
47893
48047
  var s2TypeParameters = s2.getTypeParameters();
47894
48048
  this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, true);
47895
48049
 
47896
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47897
- context.setEnclosingTypes(s1, s2);
48050
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(s1, s2);
47898
48051
  context.walkReturnTypes();
47899
48052
  var returnTypeIsIdentical = this.typesAreIdenticalInEnclosingTypes(s1.returnType, s2.returnType, context);
47900
48053
 
47901
- context.setEnclosingTypeWalkers(enclosingWalkers);
48054
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47902
48055
 
47903
48056
  this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, undefined);
47904
48057
 
@@ -47921,42 +48074,37 @@ var TypeScript;
47921
48074
  };
47922
48075
 
47923
48076
  PullTypeResolver.prototype.sourceMembersAreAssignableToTargetMembers = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47924
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47925
- context.setEnclosingTypes(source, target);
48077
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(source, target);
47926
48078
  var areSourceMembersAreAssignableToTargetMembers = this.sourceMembersAreRelatableToTargetMembers(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47927
- context.setEnclosingTypeWalkers(enclosingWalkers);
48079
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47928
48080
  return areSourceMembersAreAssignableToTargetMembers;
47929
48081
  };
47930
48082
 
47931
48083
  PullTypeResolver.prototype.sourcePropertyIsAssignableToTargetProperty = function (source, target, sourceProp, targetProp, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47932
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47933
- context.setEnclosingTypes(source, target);
48084
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(source, target);
47934
48085
  var isSourcePropertyIsAssignableToTargetProperty = this.sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47935
- context.setEnclosingTypeWalkers(enclosingWalkers);
48086
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47936
48087
  return isSourcePropertyIsAssignableToTargetProperty;
47937
48088
  };
47938
48089
 
47939
48090
  PullTypeResolver.prototype.sourceCallSignaturesAreAssignableToTargetCallSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47940
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47941
- context.setEnclosingTypes(source, target);
48091
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(source, target);
47942
48092
  var areSourceCallSignaturesAssignableToTargetCallSignatures = this.sourceCallSignaturesAreRelatableToTargetCallSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47943
- context.setEnclosingTypeWalkers(enclosingWalkers);
48093
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47944
48094
  return areSourceCallSignaturesAssignableToTargetCallSignatures;
47945
48095
  };
47946
48096
 
47947
48097
  PullTypeResolver.prototype.sourceConstructSignaturesAreAssignableToTargetConstructSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47948
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47949
- context.setEnclosingTypes(source, target);
48098
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(source, target);
47950
48099
  var areSourceConstructSignaturesAssignableToTargetConstructSignatures = this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47951
- context.setEnclosingTypeWalkers(enclosingWalkers);
48100
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47952
48101
  return areSourceConstructSignaturesAssignableToTargetConstructSignatures;
47953
48102
  };
47954
48103
 
47955
48104
  PullTypeResolver.prototype.sourceIndexSignaturesAreAssignableToTargetIndexSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47956
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47957
- context.setEnclosingTypes(source, target);
48105
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(source, target);
47958
48106
  var areSourceIndexSignaturesAssignableToTargetIndexSignatures = this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47959
- context.setEnclosingTypeWalkers(enclosingWalkers);
48107
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47960
48108
  return areSourceIndexSignaturesAssignableToTargetIndexSignatures;
47961
48109
  };
47962
48110
 
@@ -47969,10 +48117,9 @@ var TypeScript;
47969
48117
  };
47970
48118
 
47971
48119
  PullTypeResolver.prototype.signatureIsAssignableToTarget = function (s1, s2, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
47972
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
47973
- context.setEnclosingTypes(s1, s2);
48120
+ var enclosingTypeWalkerStates = context.setEnclosingTypeForSymbols(s1, s2);
47974
48121
  var isSignatureIsAssignableToTarget = this.signatureIsRelatableToTarget(s1, s2, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
47975
- context.setEnclosingTypeWalkers(enclosingWalkers);
48122
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
47976
48123
  return isSignatureIsAssignableToTarget;
47977
48124
  };
47978
48125
 
@@ -48010,9 +48157,9 @@ var TypeScript;
48010
48157
  };
48011
48158
 
48012
48159
  PullTypeResolver.prototype.sourceIsRelatableToTargetWithNewEnclosingTypes = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
48013
- var enclosingWalkers = context.resetEnclosingTypeWalkers();
48160
+ var enclosingTypeWalkerStates = context.resetEnclosingTypeWalkerStates();
48014
48161
  var isSourceRelatable = this.sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
48015
- context.setEnclosingTypeWalkers(enclosingWalkers);
48162
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
48016
48163
  return isSourceRelatable;
48017
48164
  };
48018
48165
 
@@ -48155,17 +48302,7 @@ var TypeScript;
48155
48302
  comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, true);
48156
48303
 
48157
48304
  var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(sourceApparentType, target);
48158
-
48159
- var needsSourceSubstitutionUpdate = source != sourceApparentType && context.enclosingTypeWalker1._canWalkStructure() && context.enclosingTypeWalker1._getCurrentSymbol() != sourceApparentType;
48160
- if (needsSourceSubstitutionUpdate) {
48161
- context.enclosingTypeWalker1.setCurrentSymbol(sourceApparentType);
48162
- }
48163
-
48164
- var isRelatable = this.sourceIsRelatableToTargetWorker(source, target, sourceApparentType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
48165
-
48166
- if (needsSourceSubstitutionUpdate) {
48167
- context.enclosingTypeWalker1.setCurrentSymbol(source);
48168
- }
48305
+ var isRelatable = this.sourceIsRelatableToTargetWorker(sourceApparentType, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures);
48169
48306
  context.endWalkingTypes(symbolsWhenStartedWalkingTypes);
48170
48307
 
48171
48308
  comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, isRelatable);
@@ -48184,20 +48321,20 @@ var TypeScript;
48184
48321
  return false;
48185
48322
  };
48186
48323
 
48187
- PullTypeResolver.prototype.sourceIsRelatableToTargetWorker = function (source, target, sourceSubstitution, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
48188
- if (target.hasMembers() && !this.sourceMembersAreRelatableToTargetMembers(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48324
+ PullTypeResolver.prototype.sourceIsRelatableToTargetWorker = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) {
48325
+ if (target.hasMembers() && !this.sourceMembersAreRelatableToTargetMembers(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48189
48326
  return false;
48190
48327
  }
48191
48328
 
48192
- if (!this.sourceCallSignaturesAreRelatableToTargetCallSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48329
+ if (!this.sourceCallSignaturesAreRelatableToTargetCallSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48193
48330
  return false;
48194
48331
  }
48195
48332
 
48196
- if (!this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48333
+ if (!this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48197
48334
  return false;
48198
48335
  }
48199
48336
 
48200
- if (!this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48337
+ if (!this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) {
48201
48338
  return false;
48202
48339
  }
48203
48340
 
@@ -48960,9 +49097,9 @@ var TypeScript;
48960
49097
  };
48961
49098
 
48962
49099
  PullTypeResolver.prototype.relateTypeToTypeParametersWithNewEnclosingTypes = function (expressionType, parameterType, argContext, context) {
48963
- var enclosingTypeWalkers = context.resetEnclosingTypeWalkers();
49100
+ var enclosingTypeWalkerStates = context.resetEnclosingTypeWalkerStates();
48964
49101
  this.relateTypeToTypeParameters(expressionType, parameterType, argContext, context);
48965
- context.setEnclosingTypeWalkers(enclosingTypeWalkers);
49102
+ context.setEnclosingTypeWalkerStates(enclosingTypeWalkerStates);
48966
49103
  };
48967
49104
 
48968
49105
  PullTypeResolver.prototype.relateTypeToTypeParameters = function (expressionType, parameterType, argContext, context) {
@@ -55859,14 +55996,14 @@ var TypeScript;
55859
55996
  return this.semanticInfoChain.topLevelDecl(fileName);
55860
55997
  };
55861
55998
 
55862
- TypeScriptCompiler.getLocationText = function (location) {
55863
- return location.fileName() + "(" + (location.line() + 1) + "," + (location.character() + 1) + ")";
55999
+ TypeScriptCompiler.getLocationText = function (location, resolvePath) {
56000
+ return resolvePath(location.fileName()) + "(" + (location.line() + 1) + "," + (location.character() + 1) + ")";
55864
56001
  };
55865
56002
 
55866
- TypeScriptCompiler.getFullDiagnosticText = function (diagnostic) {
56003
+ TypeScriptCompiler.getFullDiagnosticText = function (diagnostic, resolvePath) {
55867
56004
  var result = "";
55868
56005
  if (diagnostic.fileName()) {
55869
- result += this.getLocationText(diagnostic) + ": ";
56006
+ result += this.getLocationText(diagnostic, resolvePath) + ": ";
55870
56007
  }
55871
56008
 
55872
56009
  result += diagnostic.message();
@@ -55876,7 +56013,7 @@ var TypeScript;
55876
56013
  result += " " + TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Additional_locations, null) + TypeScript.Environment.newLine;
55877
56014
 
55878
56015
  for (var i = 0, n = additionalLocations.length; i < n; i++) {
55879
- result += "\t" + this.getLocationText(additionalLocations[i]) + TypeScript.Environment.newLine;
56016
+ result += "\t" + this.getLocationText(additionalLocations[i], resolvePath) + TypeScript.Environment.newLine;
55880
56017
  }
55881
56018
  } else {
55882
56019
  result += TypeScript.Environment.newLine;
@@ -62078,7 +62215,7 @@ var TypeScript;
62078
62215
  var BatchCompiler = (function () {
62079
62216
  function BatchCompiler(ioHost) {
62080
62217
  this.ioHost = ioHost;
62081
- this.compilerVersion = "1.0.0.0";
62218
+ this.compilerVersion = "1.0.1.0";
62082
62219
  this.inputFiles = [];
62083
62220
  this.resolvedFiles = [];
62084
62221
  this.fileNameToSourceFile = new TypeScript.StringHashTable();
@@ -62733,12 +62870,15 @@ var TypeScript;
62733
62870
  };
62734
62871
 
62735
62872
  BatchCompiler.prototype.addDiagnostic = function (diagnostic) {
62873
+ var _this = this;
62736
62874
  var diagnosticInfo = diagnostic.info();
62737
62875
  if (diagnosticInfo.category === 1 /* Error */) {
62738
62876
  this.hasErrors = true;
62739
62877
  }
62740
62878
 
62741
- this.ioHost.stderr.Write(TypeScript.TypeScriptCompiler.getFullDiagnosticText(diagnostic));
62879
+ this.ioHost.stderr.Write(TypeScript.TypeScriptCompiler.getFullDiagnosticText(diagnostic, function (path) {
62880
+ return _this.resolvePath(path);
62881
+ }));
62742
62882
  };
62743
62883
 
62744
62884
  BatchCompiler.prototype.tryWriteOutputFiles = function (outputFiles) {