@samitouri / QOS-React / commits / d1dbb00790

[hir] Throw if Effect.Store is not handled

Sathya Gunasekaran committed Feb 7, 2023 at 16:59 UTC d1dbb007901a2be3a8ae55e12c72f703c7c89391
1 file changed +10
compiler/forget/src/Inference/InferAliasForStores.ts
+10
@@ -11,6 +11,7 @@ import {
11 InstructionId,
12 Place,
13 } from "../HIR/HIR";
14 +import { printInstructionValue } from "../HIR/PrintHIR";
15 import { eachInstructionValueOperand } from "../HIR/visitors";
16 import DisjointSet from "../Utils/DisjointSet";
17
@@ -40,6 +41,15 @@ export function inferAliasForStores(
41 }
42 break;
43 }
44 + default: {
45 + // Effect.Capture & Effect.Store are only used for aliasing
46 + // instructions.
47 + throw new Error(
48 + `Unexpected capture/store instruction: ${printInstructionValue(
49 + value
50 + )}`
51 + );
52 + }
53 }
54 }
55 }