一行程序helloworld
///<reference path='/Users/tadams/git/typescript/src/compiler/typescript.ts'/>
打破 typescript-0.9.0
错误是 bash-3.2$ tsc helloworld.ts
/Users/tadams/git/typescript/bin/tsc.js:42270
comparisonInfo.flags |= 128 /* InconsistantPropertyAccesib
^
TypeError: Cannot read property 'flags' of undefined
at PullTypeResolver.sourcePropertyIsRelatableToTargetProperty (/Users/tadams/git/typescript/bin/tsc.js:42270:35)
at PullTypeResolver.sourceMembersAreRelatableToTargetMembers (/Users/tadams/git/typescript/bin/tsc.js:42243:27)
at PullTypeResolver.sourceIsRelatableToTarget (/Users/tadams/git/typescript/bin/tsc.js:42183:46)
at PullTypeResolver.sourceIsAssignableToTarget (/Users/tadams/git/typescript/bin/tsc.js:42003:25)
at PullTypeResolver.computeCallExpressionSymbol (/Users/tadams/git/typescript/bin/tsc.js:41007:51)
at PullTypeResolver.resolveCallExpression (/Users/tadams/git/typescript/bin/tsc.js:40891:29)
at PullTypeChecker.typeCheckCallExpression (/Users/tadams/git/typescript/bin/tsc.js:44820:58)
at PullTypeChecker.typeCheckAST (/Users/tadams/git/typescript/bin/tsc.js:43506:33)
at PullTypeChecker.typeCheckReturnStatement (/Users/tadams/git/typescript/bin/tsc.js:45394:35)
at PullTypeChecker.typeCheckAST (/Users/tadams/git/typescript/bin/tsc.js:43639:33)
有谁知道发生了什么或此错误消息意味着什么?在 Mac OS X 10.8 上运行 typescript-0.9.0。谢谢!
更新:打字稿 .9 中有一个错误。没有使用足够的参数调用方法,这导致了这个奇怪的错误。这是错误补丁差异。
diff --git a/src/compiler/typecheck/pullTypeResolution.ts b/src/compiler/typecheck/pullTypeResolution.ts
index ec3d236..801ed2f 100644
--- a/src/compiler/typecheck/pullTypeResolution.ts
+++ b/src/compiler/typecheck/pullTypeResolution.ts
@@ -4001,7 +4001,7 @@ module TypeScript {
getTypeAtIndex: (index: number) => { return rightType; } // we only want the "second" type - the "first" is skipped
}
- var bestCommonType = this.findBestCommonType(leftType, null, collection, context);
+ var bestCommonType = this.findBestCommonType(leftType, null, collection, context, new TypeComparisonInfo());
if (bestCommonType) {
symbol = bestCommonType;
@@ -6442,7 +6442,7 @@ module TypeScript {
setTypeAtIndex: (index: number, type: PullTypeSymbol) => { } , // no contextual typing here, so no need to do anything
getTypeAtIndex: (index: number) => { return index ? Q.signature.getReturnType() : best.signature.getReturnType(); } // we only want the "second" type - the "first" is skippe
}
- var bct = this.findBestCommonType(best.signature.getReturnType(), null, collection, context);
+ var bct = this.findBestCommonType(best.signature.getReturnType(), null, collection, context, new TypeComparisonInfo());
ambiguous = !bct;
}
else {
@@ -6844,4 +6844,4 @@ module TypeScript {
return sig;
}
}
-}
\ No newline at end of file
+}`