summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-05-27 13:36:48 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-05-29 19:57:02 +0200
commit851e39991e7a929e1d83d5e35a024d5b9bd0b75f (patch)
treed31ab190abb8db0d3c21bd017098bfb6aebc62f6 /src
parent0da2b2c96b6dc91d95a54725bc04381fc0eda43b (diff)
downloadscala-851e39991e7a929e1d83d5e35a024d5b9bd0b75f.tar.gz
scala-851e39991e7a929e1d83d5e35a024d5b9bd0b75f.tar.bz2
scala-851e39991e7a929e1d83d5e35a024d5b9bd0b75f.zip
SI-7516 Revert "SI-7234 Make named args play nice w. depmet types"
This reverts commit 83c9c764b528a7a1c1d39c480d22c8e3a71d5a58. The tests are shunted to 'pending'. Why revert this seemingly innocous commit? 83c9c764 generates a ValDef whose tpt TypeTree has no original; this contains a reference to the symbol for `d`. resetAttrs and the retypecheck assigns a new symbol for d and leaves a the reference to the prior symbol dangling. The real bug is the resetAttrs concept.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index 802df39f01..d54f894c62 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -284,11 +284,13 @@ trait NamesDefaults { self: Analyzer =>
case Typed(expr, Ident(tpnme.WILDCARD_STAR)) => expr.tpe
case _ => seqType(arg.tpe)
}
- else
- // Note stabilizing can lead to a non-conformant argument when existentials are involved, e.g. neg/t3507-old.scala, hence the filter.
- // We have to deconst or types inferred from literal arguments will be Constant(_), e.g. pos/z1730.scala.
- gen.stableTypeFor(arg).filter(_ <:< paramTpe).getOrElse(arg.tpe).deconst
- )
+ else {
+ // TODO In 83c9c764b, we tried to a stable type here to fix SI-7234. But the resulting TypeTree over a
+ // singleton type without an original TypeTree fails to retypecheck after a resetLocalAttrs (SI-7516),
+ // which is important for (at least) macros.
+ arg.tpe
+ }
+ ).widen // have to widen or types inferred from literal defaults will be singletons
val s = context.owner.newValue(unit.freshTermName("x$"), arg.pos) setInfo (
if (byName) functionType(Nil, argTpe) else argTpe
)