Fix some small compile-time and runtime errors
This commit is contained in:
parent
475f11782e
commit
68942f4488
2 changed files with 7 additions and 7 deletions
|
@ -20,7 +20,6 @@ import { BOLT_SUPPORTED_LANGUAGES } from "./constants"
|
||||||
import {FastStringMap, enumOr, escapeChar, assert} from "./util";
|
import {FastStringMap, enumOr, escapeChar, assert} from "./util";
|
||||||
import {TextSpan, TextPos, TextFile} from "./text";
|
import {TextSpan, TextPos, TextFile} from "./text";
|
||||||
import {Scanner} from "./scanner";
|
import {Scanner} from "./scanner";
|
||||||
import * as path from "path"
|
|
||||||
import { convertNodeToSymbolPath } from "./resolver";
|
import { convertNodeToSymbolPath } from "./resolver";
|
||||||
import { TYPE_ERROR_MESSAGES } from "./diagnostics";
|
import { TYPE_ERROR_MESSAGES } from "./diagnostics";
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ export function getSourceFile(node: Syntax) {
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
assert(node.parentNode !== null);
|
assert(node.parentNode !== null);
|
||||||
node = node.parentNode;
|
node = node.parentNode!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { BoltSyntax, SyntaxKind, Syntax, BoltSourceFile, SourceFile, kindToString } from "./ast";
|
import { BoltSyntax, SyntaxKind, Syntax, BoltSourceFile, SourceFile, kindToString } from "./ast";
|
||||||
import { emitNode } from "./emitter";
|
import { emitNode } from "./emitter";
|
||||||
import { Package, isExported } from "./common";
|
import { isExported } from "./common";
|
||||||
|
import { Package } from "./package"
|
||||||
import { FastStringMap, assert, every } from "./util";
|
import { FastStringMap, assert, every } from "./util";
|
||||||
import { Program } from "./program";
|
import { Program } from "./program";
|
||||||
|
|
||||||
|
@ -236,14 +237,14 @@ export class BoltSymbolResolutionStrategy implements ResolutionStrategy {
|
||||||
let currNode = source.node;
|
let currNode = source.node;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (currNode.kind === SyntaxKind.BoltSourceFile) {
|
if (currNode.kind === SyntaxKind.BoltSourceFile) {
|
||||||
return new PackageScopeSource(currNode.package);
|
return new PackageScopeSource(currNode.pkg);
|
||||||
}
|
}
|
||||||
const nextNode = currNode.parentNode;
|
const nextNode = currNode.parentNode;
|
||||||
assert(nextNode !== null);
|
assert(nextNode !== null);
|
||||||
if (this.introducesNewScope(new NodeScopeSource(nextNode), kind)) {
|
if (this.introducesNewScope(new NodeScopeSource(nextNode!), kind)) {
|
||||||
return new NodeScopeSource(nextNode);
|
return new NodeScopeSource(nextNode!);
|
||||||
}
|
}
|
||||||
currNode = nextNode;
|
currNode = nextNode!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue