Skip to content

Commit 897f245

Browse files
authored
Merge pull request #5838 from unisonweb/topic/type-errors
Missing transcript update from #5837
2 parents 4d04ae4 + 4bd8759 commit 897f245

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

parser-typechecker/src/Unison/PrintError.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,15 @@ renderTypeError e env src = case e of
346346
"",
347347
Pr.indentN 4 . style Type1 $ renderType' env foundType,
348348
"",
349-
showSourceMaybes src
349+
showSourceMaybes
350+
src
350351
[(,Type1) <$> rangeForAnnotated mismatchSite],
351352
Pr.wrap . mconcat $
352-
[ "All actions are expected to have a type of",
353-
style Type2 "Unit",
354-
"to catch accidental delayed values. To explicitly",
355-
"ignore a result, use:"
356-
],
353+
[ "All actions are expected to have a type of",
354+
style Type2 "Unit",
355+
"to catch accidental delayed values. To explicitly",
356+
"ignore a result, use:"
357+
],
357358
"",
358359
Pr.indentN 4 $ style Type1 "_ = <expr>"
359360
],

parser-typechecker/src/Unison/Typechecker/TypeError.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ actionRestriction = do
361361
note <- Ex.errorNote
362362
mismatchSite <- Ex.innermostTerm
363363
path <- Ex.path
364-
let subtypes = [ t1 | C.InSubtype t1 _ <- path ]
364+
let subtypes = [t1 | C.InSubtype t1 _ <- path]
365365
guard . not $ null subtypes
366366
let foundType = Type.cleanup $ last subtypes
367367
pure $ ActionRestrictionFailure foundType mismatchSite note

unison-src/transcripts/idempotent/fix693.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ h0 req = match req with
4343
``` ucm :added-by-ucm
4444
Loading changes detected in scratch.u.
4545
46-
I found a value of type: a
47-
where I expected to find: b
46+
I found a value of type: Optional a
47+
where I expected to find: Optional b
4848
4949
1 | h0 : Request {X t} b -> Optional b
5050
2 | h0 req = match req with
@@ -63,8 +63,8 @@ h1 req = match req with
6363
``` ucm :added-by-ucm
6464
Loading changes detected in scratch.u.
6565
66-
I found a value of type: t
67-
where I expected to find: b
66+
I found a value of type: Optional t
67+
where I expected to find: Optional b
6868
6969
1 | h1 : Request {X t} b -> Optional b
7070
2 | h1 req = match req with

0 commit comments

Comments
 (0)