From 394666118d565d00cf2874c6c71e2c92ce714606 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Wed, 8 Feb 2023 17:45:33 +0000 Subject: [PATCH] [hir] Lower function expressions into HIR --- compiler/forget/src/Inference/InferReferenceEffects.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/forget/src/Inference/InferReferenceEffects.ts b/compiler/forget/src/Inference/InferReferenceEffects.ts index 6595e9f128..79400f07dc 100644 --- a/compiler/forget/src/Inference/InferReferenceEffects.ts +++ b/compiler/forget/src/Inference/InferReferenceEffects.ts @@ -227,10 +227,11 @@ class Environment { */ alias(place: Place, value: Place) { const values = this.#variables.get(value.identifier.id); - // A value can be undefined if it has been captured from outside scope. - if (value === undefined) { - return; - } + invariant( + values != null, + "Expected value for identifier `%s` to be initialized.", + value.identifier.id + ); this.#variables.set(place.identifier.id, new Set(values)); }