Skip to content

Commit c8bf8c4

Browse files
authored
Merge pull request #1749 from dotty-staging/fix-i1748
fix #1748: desugaring with StringContext in PatDef
2 parents 566e8f7 + 8f3301e commit c8bf8c4

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,8 @@ object desugar {
10791079
collect(tree)
10801080
case Tuple(trees) =>
10811081
trees foreach collect
1082+
case Thicket(trees) =>
1083+
trees foreach collect
10821084
case _ =>
10831085
}
10841086
collect(tree)

tests/run/i1748.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class
2+
extends

tests/run/i1748.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
object Test {
2+
implicit class Foo(sc: StringContext) {
3+
object q {
4+
def unapply(arg: Any): Option[(Any, Any)] =
5+
Some((sc.parts(0), sc.parts(1)))
6+
}
7+
}
8+
9+
def main(args: Array[String]): Unit = {
10+
val q"class $name extends $parent" = new Object
11+
println(name)
12+
println(parent)
13+
}
14+
}

0 commit comments

Comments
 (0)