Skip to content

Commit 5e15be9

Browse files
committed
Merge remote-tracking branch 'origin/master' into portLibFiles731
2 parents 5a8804f + 9277ec0 commit 5e15be9

File tree

3,785 files changed

+298
-56047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,785 files changed

+298
-56047
lines changed

src/harness/typeWriter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ class TypeWriterWalker {
7575
const sourceText = ts.getSourceTextOfNodeFromSourceFile(this.currentSourceFile, node);
7676

7777
if (!isSymbolWalk) {
78+
// Don't try to get the type of something that's already a type.
79+
// Exception for `T` in `type T = something` because that may evaluate to some interesting type.
80+
if (ts.isPartOfTypeNode(node) || ts.isIdentifier(node) && !(ts.getMeaningFromDeclaration(node.parent) & ts.SemanticMeaning.Value) && !(ts.isTypeAlias(node.parent) && node.parent.name === node)) {
81+
return undefined;
82+
}
83+
7884
// Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions
7985
// let type = this.checker.getTypeAtLocation(node);
8086
const type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node);

0 commit comments

Comments
 (0)