We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b54b1c6 commit bb0be81Copy full SHA for bb0be81
compiler/src/dotty/tools/dotc/transform/UnusedRefs.scala
@@ -44,13 +44,9 @@ class UnusedRefs extends MiniPhase {
44
tree.tpe.widen match {
45
case _: MethodType => tree // Do the transformation higher in the tree if needed
46
case _ =>
47
- val result = defaultValue(tree.tpe) match {
48
- case t @ TypeApply(fun, args) => cpy.TypeApply(t)(fun = fun, args = args.map(transformAllDeep)) // asInstanceOf inserted by defaultValue
49
- case t => t
50
- }
51
tree match {
52
- case _: RefTree => result
53
- case Apply(_ , args) => seq(args, result)
+ case _: RefTree => defaultValue(tree.tpe)
+ case Apply(_ , args) => seq(args, defaultValue(tree.tpe))
54
}
55
56
0 commit comments