diff --git a/src/common.ts b/src/common.ts index 496a647a9..4678dc2a9 100644 --- a/src/common.ts +++ b/src/common.ts @@ -20,7 +20,6 @@ import { BOLT_SUPPORTED_LANGUAGES } from "./constants" import {FastStringMap, enumOr, escapeChar, assert} from "./util"; import {TextSpan, TextPos, TextFile} from "./text"; import {Scanner} from "./scanner"; -import * as path from "path" import { convertNodeToSymbolPath } from "./resolver"; import { TYPE_ERROR_MESSAGES } from "./diagnostics"; @@ -30,7 +29,7 @@ export function getSourceFile(node: Syntax) { return node } assert(node.parentNode !== null); - node = node.parentNode; + node = node.parentNode!; } } diff --git a/src/resolver.ts b/src/resolver.ts index 95f08653b..cc70b9fed 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -1,6 +1,7 @@ import { BoltSyntax, SyntaxKind, Syntax, BoltSourceFile, SourceFile, kindToString } from "./ast"; import { emitNode } from "./emitter"; -import { Package, isExported } from "./common"; +import { isExported } from "./common"; +import { Package } from "./package" import { FastStringMap, assert, every } from "./util"; import { Program } from "./program"; @@ -236,14 +237,14 @@ export class BoltSymbolResolutionStrategy implements ResolutionStrategy { let currNode = source.node; while (true) { if (currNode.kind === SyntaxKind.BoltSourceFile) { - return new PackageScopeSource(currNode.package); + return new PackageScopeSource(currNode.pkg); } const nextNode = currNode.parentNode; assert(nextNode !== null); - if (this.introducesNewScope(new NodeScopeSource(nextNode), kind)) { - return new NodeScopeSource(nextNode); + if (this.introducesNewScope(new NodeScopeSource(nextNode!), kind)) { + return new NodeScopeSource(nextNode!); } - currNode = nextNode; + currNode = nextNode!; } }