summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2019-06-04 14:31:08 -0400
committerAlp Mestanogullari <alp@well-typed.com>2019-08-14 17:47:25 -0400
commit6329c70a36242849540c93b34903f6188b0ed477 (patch)
treef341da692c9f7707be90939f9e890f28625d5402 /compiler/coreSyn
parentaa4d8b07edad74c29acdcf06cf1b4c3ff6b97ffa (diff)
downloadhaskell-6329c70a36242849540c93b34903f6188b0ed477.tar.gz
GHCi supports not-necessarily-lifted join points
Fixes #16509. See Note [Not-necessarily-lifted join points] in ByteCodeGen, which tells the full story. This commit also adds some comments and cleans some code in the byte-code generator, as I was exploring around trying to understand it. (This commit removes an old test -- this is really a GHCi problem, not a pattern-synonym problem.) test case: ghci/scripts/T16509
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/CoreSyn.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreSyn.hs b/compiler/coreSyn/CoreSyn.hs
index 725e8da826..16123e7b3a 100644
--- a/compiler/coreSyn/CoreSyn.hs
+++ b/compiler/coreSyn/CoreSyn.hs
@@ -655,6 +655,16 @@ invariant 3 does still need to be checked.) For the rigorous definition of
Invariant 4 is subtle; see Note [The polymorphism rule of join points].
+Invariant 6 is to enable code like this:
+
+ f = \(r :: RuntimeRep) (a :: TYPE r) (x :: T).
+ join j :: a
+ j = error @r @a "bloop"
+ in case x of
+ A -> j
+ B -> j
+ C -> error @r @a "blurp"
+
Core Lint will check these invariants, anticipating that any binder whose
OccInfo is marked AlwaysTailCalled will become a join point as soon as the
simplifier (or simpleOptPgm) runs.