Closed
Description
To reproduce, running from commit db24246
$ cat target/union.scala
object a {
val x: String | Int = 'a
}
$ time ./bin/dotc target/union.scala
-- [E007] Type Mismatch Error: target/union.scala ------------------------------
2 | val x: String | Int = 'a
| ^^
| found: Symbol
| required: String | Int
|
one error found
./bin/dotc target/union.scala 30.37s user 1.44s system 262% cpu 12.094 total
I ran jprofiler on a repl session to see what was happening and got these results
union-typeerror.zip
I don't know much about Dotty's typer to make sense of the report.
My understanding from @DarkDimius's comment on Gitter is that union types put a strain on the type-checker for several fundamental reasons. However, 12s to report a type-error on a minimal example sounds like a bug to me.
Metadata
Metadata
Assignees
Labels
No labels