From 7a36c2584872ec89705dba0e5a213f6bc13aaf92 Mon Sep 17 00:00:00 2001 From: Folkert Date: Mon, 21 Jun 2021 21:24:46 +0200 Subject: [PATCH] simpify pattern match on non-indexable values --- compiler/mono/src/decision_tree.rs | 6 +++--- compiler/test_mono/generated/optional_when.txt | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/compiler/mono/src/decision_tree.rs b/compiler/mono/src/decision_tree.rs index 04d25e0b78..4883abd7fb 100644 --- a/compiler/mono/src/decision_tree.rs +++ b/compiler/mono/src/decision_tree.rs @@ -1057,9 +1057,9 @@ fn path_to_expr_help<'a>( wrapped: Wrapped::SingleElementRecord, }; - symbol = env.unique_symbol(); - let inner_layout = layout; - stores.push((symbol, inner_layout, inner_expr)); + // symbol = env.unique_symbol(); + // let inner_layout = layout; + // stores.push((symbol, inner_layout, inner_expr)); break; } diff --git a/compiler/test_mono/generated/optional_when.txt b/compiler/test_mono/generated/optional_when.txt index f1e9f636d0..864d5dbb38 100644 --- a/compiler/test_mono/generated/optional_when.txt +++ b/compiler/test_mono/generated/optional_when.txt @@ -14,10 +14,9 @@ procedure Test.1 (Test.6): ret Test.10; procedure Test.1 (Test.6): - let Test.36 = Index 0 Test.6; - let Test.37 = false; - let Test.38 = lowlevel Eq Test.37 Test.36; - if Test.38 then + let Test.36 = false; + let Test.37 = lowlevel Eq Test.36 Test.6; + if Test.37 then let Test.8 = 3i64; ret Test.8; else @@ -25,10 +24,10 @@ procedure Test.1 (Test.6): ret Test.10; procedure Test.0 (): - let Test.41 = true; - let Test.5 = CallByName Test.1 Test.41; - let Test.39 = false; - let Test.3 = CallByName Test.1 Test.39; + let Test.40 = true; + let Test.5 = CallByName Test.1 Test.40; + let Test.38 = false; + let Test.3 = CallByName Test.1 Test.38; let Test.31 = 11i64; let Test.32 = true; let Test.30 = Struct {Test.31, Test.32};