Skip to content

Commit 74cee6a

Browse files
committed
fix #1748: desugaring with StringContext in PatDef
1 parent 566e8f7 commit 74cee6a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-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/pos/i1784.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(args: Any*): Option[(Any, Any)] =
5+
Some((sc.parts(0), sc.parts(1)))
6+
}
7+
}
8+
9+
def f(defn: Any): Any = {
10+
val q"class $name extends $parent" = defn
11+
println(name)
12+
println(parent)
13+
}
14+
}

0 commit comments

Comments
 (0)