Skip to content

Commit 5d9440a

Browse files
committed
Revise GADT text
1 parent 88e97bd commit 5d9440a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/blog/_posts/2018-03-05-seventh-dotty-milestone-release.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ case class Fun[S, T](f: Exp[S] => Exp[T]) extends Exp[S => T]
131131
case class App[T, U](f: Exp[T => U], e: Exp[T]) extends Exp[U]
132132
```
133133

134-
where different constructors, such as `IntLit` and `Fun`, pass different type argument to the super trait. Hence, typechecking a pattern match on `v: Exp[T]` requires special care: for instance, if `v = IntLit(5)` then `T` must be `Int`. This enables writing a typed interpreter `eval[T](e: Exp[T]): T`. In each pattern matching branch
134+
where different constructors, such as `IntLit` and `Fun`, pass different type argument to the super trait. Hence, typechecking a pattern match on `v: Exp[T]` requires special care: for instance, if `v = IntLit(5)` then the typechecker must realize that `T` must be `Int`. This enables writing a typed interpreter `eval[T](e: Exp[T]): T`, where say the `IntLit` branch can return an `Int`:
135135

136136
```scala
137137
object Interpreter {
@@ -169,7 +169,6 @@ We have fixed multiple bugs about GADT type checking and exhaustiveness checking
169169
[#3645](https://github.com/lampepfl/dotty/issues/3645),
170170
and improved handling of matches using repeated type variables
171171
[#4030](https://github.com/lampepfl/dotty/issues/4030).
172-
More test cases appear in [#3999](https://github.com/lampepfl/dotty/pull/3999).
173172
We have also made error messages more informative [#3990](https://github.com/lampepfl/dotty/pull/3990).
174173
Fixes to covariant GADTs ([#3989](https://github.com/lampepfl/dotty/issues/3989)/
175174
[#4013](https://github.com/lampepfl/dotty/pull/4013)) have been deferred to next release.

0 commit comments

Comments
 (0)