Skip to content

Commit ab94c0a

Browse files
Fix char default (#1095)
fixes #1075
1 parent fd0b611 commit ab94c0a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

effekt/shared/src/main/scala/effekt/core/PolymorphismBoxing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ object PolymorphismBoxing extends Phase[CoreTransformed, CoreTransformed] {
424424
case core.Type.TInt => Pure.Literal(1337L, core.Type.TInt)
425425
case core.Type.TDouble => Pure.Literal(13.37, core.Type.TDouble)
426426
case core.Type.TByte => Pure.Literal(1337, core.Type.TByte)
427-
case core.Type.TChar => Pure.Literal('a', core.Type.TChar)
427+
case core.Type.TChar => Pure.Literal(1337, core.Type.TChar)
428428
case t if boxer.isDefinedAt(t) => sys error s"No default value defined for ${t}"
429429
case _ => sys error s"Trying to unbox Nothing to ${t}"
430430
}

examples/stdlib/char/char_default.check

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
effect fail(): Nothing
2+
3+
def f(): Char / fail = do fail()
4+
5+
def main(): Unit =
6+
try {
7+
println(show(f()))
8+
} with fail {
9+
()
10+
}

0 commit comments

Comments
 (0)