-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Scalac doesn't parse following programs syntactically, but support it if it's synthesized.
Dotty accepts the code syntactically, but the typer generates a typing error.
object Test {
val a = (3, 4) match {
case ({name: Int}, {parent: Int}) => (name, parent)
}
val name = a._1
val parent = a._2
}Error message:
-- Error: examples/block.scala -------------------------------------------------
6 | val name = a._1
| ^
| cyclic reference involving value a
-- Error: examples/block.scala -------------------------------------------------
7 | val parent = a._2
| ^
| cyclic reference involving value a
-- Error: examples/block.scala -------------------------------------------------
3 | case ({name: Int}, {parent: Int}) => (name, parent)
| ^^^^
| cyclic reference involving value a
three errors found