Skip to content

Commit 97fc6ba

Browse files
committed
Remove useless case
This branch should have been removed whe the logic in the staging Staging phase was split
1 parent c26a03b commit 97fc6ba

File tree

4 files changed

+46
-13
lines changed

4 files changed

+46
-13
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,6 @@ class ReifyQuotes extends MacroTransform {
351351
// typer to allow pickling/unpickling phase consistent types
352352
transformSplice(spliceTree)
353353

354-
case tree: TypeTree if tree.tpe.typeSymbol.isSplice =>
355-
tree.tpe.stripTypeVar match {
356-
case tp: AppliedType =>
357-
val splicedType = tp.tycon.asInstanceOf[TypeRef].prefix.termSymbol
358-
AppliedTypeTree(transformSplice(ref(splicedType).select(tpnme.splice)), tp.args.map(TypeTree(_))).withSpan(tree.span)
359-
case tp: TypeRef =>
360-
val splicedType = tp.prefix.termSymbol
361-
transformSplice(ref(splicedType).select(tpnme.splice).withSpan(tree.span))
362-
}
363-
364354
case tree: RefTree if isCaptured(tree.symbol, level) =>
365355
val t = capturers(tree.symbol).apply(tree)
366356
transformSplice(t.select(if (tree.isTerm) nme.splice else tpnme.splice))

tests/run-with-compiler/i5965.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
val y: collection.immutable.List[scala.Int] = scala.List.apply[scala.Int](1, 2, 3)
3-
(y: collection.immutable.List[evidence$1$_~$1])
3+
(y: collection.immutable.List[scala.Int])
44
}
55
List(1, 2, 3)
66
{
77
val y: scala.Option[scala.Int] = scala.Option.apply[scala.Int](4)
8-
(y: scala.Option[evidence$1$_~$1])
8+
(y: scala.Option[scala.Int])
99
}
1010
Some(4)
1111
{
1212
val y: collection.immutable.Map[scala.Int, scala.Int] = scala.Predef.Map.apply[scala.Int, scala.Int](scala.Predef.ArrowAssoc[scala.Int](4).->[scala.Int](1))
13-
(y: collection.immutable.Map[scala.Int, evidence$1$_~$1])
13+
(y: collection.immutable.Map[scala.Int, scala.Int])
1414
}
1515
Map(4 -> 1)

tests/run-with-compiler/i5965b.check

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
val y: collection.immutable.List[scala.Int] = scala.List.apply[scala.Int](1, 2, 3)
3+
(y: collection.immutable.List[scala.Int])
4+
}
5+
List(1, 2, 3)
6+
{
7+
val y: scala.Option[scala.Int] = scala.Option.apply[scala.Int](4)
8+
(y: scala.Option[scala.Int])
9+
}
10+
Some(4)
11+
{
12+
val y: collection.immutable.Map[scala.Int, scala.Int] = scala.Predef.Map.apply[scala.Int, scala.Int](scala.Predef.ArrowAssoc[scala.Int](4).->[scala.Int](1))
13+
(y: collection.immutable.Map[scala.Int, scala.Int])
14+
}
15+
Map(4 -> 1)

tests/run-with-compiler/i5965b.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import scala.quoted._
2+
3+
import scala.tasty._
4+
5+
object Test {
6+
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8+
9+
def main(args: Array[String]): Unit = {
10+
'[List]
11+
val list = bound('{List(1, 2, 3)})
12+
println(list.show)
13+
println(list.run)
14+
15+
val opt = bound('{Option(4)})
16+
println(opt.show)
17+
println(opt.run)
18+
19+
val map = bound('{Map(4 -> 1)})
20+
println(map.show)
21+
println(map.run)
22+
}
23+
24+
def bound[T: Type, S[_]: Type](x: Expr[S[T]]): Expr[S[T]] = '{
25+
val y = $x
26+
y
27+
}
28+
}

0 commit comments

Comments
 (0)