diff --git a/src/Juvix/Compiler/Internal/Language.hs b/src/Juvix/Compiler/Internal/Language.hs index 662c691513..ce43ab97c7 100644 --- a/src/Juvix/Compiler/Internal/Language.hs +++ b/src/Juvix/Compiler/Internal/Language.hs @@ -669,7 +669,7 @@ instance HasLoc CaseBranch where getLoc c = getLoc (c ^. caseBranchPattern) <> getLoc (c ^. caseBranchRhs) instance HasLoc Case where - getLoc c = getLocSpan (c ^. caseBranches) + getLoc c = getLoc (c ^. caseExpression) <> getLocSpan (c ^. caseBranches) instance HasLoc Expression where getLoc = \case diff --git a/tests/positive/Format.juvix b/tests/positive/Format.juvix index 6e08aa7b9f..65021767c3 100644 --- a/tests/positive/Format.juvix +++ b/tests/positive/Format.juvix @@ -465,7 +465,8 @@ module SideIfConditions; | suc (suc n) | if 0 < 0 := 3 | else := n - | suc n if 0 < 0 := 3; + | suc n if 0 < 0 := 3 + | suc zero := 5; end; module MultiIf;