mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 15:28:15 +03:00
Merge remote-tracking branch 'origin/trunk' into fix/2133
This commit is contained in:
commit
2d1b85e89f
@ -1030,11 +1030,15 @@ anfBlock (Match' scrut cas) = do
|
||||
mdf
|
||||
AccumEmpty -> pure (sctx <> cx, pure $ TMatch v MatchEmpty)
|
||||
anfBlock (Let1Named' v b e)
|
||||
= anfBlock b >>= \(bctx, (d0, cb)) -> bindLocal [v] $ do
|
||||
(ectx, ce) <- anfBlock e
|
||||
d <- bindDirection d0
|
||||
let octx = bctx <> directed [ST1 d v BX cb] <> ectx
|
||||
pure (octx, ce)
|
||||
= anfBlock b >>= \case
|
||||
(bctx, (Direct, TVar u)) -> do
|
||||
(ectx, ce) <- anfBlock e
|
||||
pure (bctx <> ectx, ABTN.rename v u <$> ce)
|
||||
(bctx, (d0, cb)) -> bindLocal [v] $ do
|
||||
(ectx, ce) <- anfBlock e
|
||||
d <- bindDirection d0
|
||||
let octx = bctx <> directed [ST1 d v BX cb] <> ectx
|
||||
pure (octx, ce)
|
||||
anfBlock (Apps' f args) = do
|
||||
(fctx, (d, cf)) <- anfFunc f
|
||||
(actx, cas) <- anfArgs args
|
||||
|
@ -916,7 +916,7 @@ emitLet _ grp _ _ _ ctx (TApp (FPrim p) args)
|
||||
= fmap (Ins . either emitPOp emitFOp p $ emitArgs grp ctx args)
|
||||
emitLet rns grp rec d vcs ctx bnd
|
||||
| Direct <- d
|
||||
= internalBug $ "unsupported compound direct let" ++ show bnd
|
||||
= internalBug $ "unsupported compound direct let: " ++ show bnd
|
||||
| Indirect w <- d
|
||||
= \esect ->
|
||||
f <$> emitSection rns grp rec (Block ctx) bnd
|
||||
|
19
unison-src/transcripts/fix2187.md
Normal file
19
unison-src/transcripts/fix2187.md
Normal file
@ -0,0 +1,19 @@
|
||||
```ucm:hide
|
||||
.> builtins.mergeio
|
||||
```
|
||||
|
||||
```unison
|
||||
|
||||
lexicalScopeEx: [Text]
|
||||
lexicalScopeEx =
|
||||
parent = "outer"
|
||||
inner1 = let
|
||||
child1 = "child1"
|
||||
inner2 : [Text]
|
||||
inner2 = let
|
||||
child2 = "child2"
|
||||
[parent, child1, child2]
|
||||
inner2
|
||||
inner1
|
||||
|
||||
```
|
26
unison-src/transcripts/fix2187.output.md
Normal file
26
unison-src/transcripts/fix2187.output.md
Normal file
@ -0,0 +1,26 @@
|
||||
```unison
|
||||
lexicalScopeEx: [Text]
|
||||
lexicalScopeEx =
|
||||
parent = "outer"
|
||||
inner1 = let
|
||||
child1 = "child1"
|
||||
inner2 : [Text]
|
||||
inner2 = let
|
||||
child2 = "child2"
|
||||
[parent, child1, child2]
|
||||
inner2
|
||||
inner1
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
|
||||
I found and typechecked these definitions in scratch.u. If you
|
||||
do an `add` or `update`, here's how your codebase would
|
||||
change:
|
||||
|
||||
⍟ These new definitions are ok to `add`:
|
||||
|
||||
lexicalScopeEx : [Text]
|
||||
|
||||
```
|
Loading…
Reference in New Issue
Block a user