-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dda114f
commit 8689ae5
Showing
3 changed files
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type * as Syntax from "~/bnf/syntax.d.ts"; | ||
import { red } from "https://deno.land/[email protected]/fmt/colors.ts"; | ||
|
||
import { AssertUnreachable, LatentOffset } from "~/helper.ts"; | ||
import { BasePointerType, LinearType } from "~/compiler/codegen/expression/type.ts"; | ||
|
@@ -60,9 +61,15 @@ export function ResolveLinearType(ctx: Context, type: LinearType, ref: Reference | |
if (strict) { | ||
const errs = type.getCompositionErrors(); | ||
if (errs) { | ||
console.error(`Unable to compose value due to some arguments being uninitialized since: ${errs.map(x => x.start.toString()).join(", ")}\n` | ||
const range = ref.clone(); | ||
for (const err of errs) { | ||
range.span(err); | ||
} | ||
|
||
console.error(`${red("Error")}: Unable to compose value due to some arguments being uninitialized since: ${errs.map(x => x.start.toString()).join(", ")}\n` | ||
+ errs.map(x => SourceView(ctx.file.path, ctx.file.name, x, true)).join("") | ||
+ SourceView(ctx.file.path, ctx.file.name, ref, false) | ||
+ SourceView(ctx.file.path, ctx.file.name, ref, true) | ||
+ ` ${ctx.file.name} ${range.toString()}\n` | ||
); | ||
|
||
ctx.file.markFailure(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters