summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-03-03 23:32:26 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-03 23:32:26 -0800
commitf482d5bdd0722e54cb3cfc2219df93da5f435bac (patch)
tree75649efafadabd20d2bb68c931e24c0ccc9303b0 /src
parent2cf6c5d7e5cfbd60958eac0a545f5c2978a8e5cd (diff)
parent33e32179fd6dcf06554b817f54b97ac5a6e052ab (diff)
downloadscala-f482d5bdd0722e54cb3cfc2219df93da5f435bac.tar.gz
scala-f482d5bdd0722e54cb3cfc2219df93da5f435bac.tar.bz2
scala-f482d5bdd0722e54cb3cfc2219df93da5f435bac.zip
Merge 2.10.1 into 2.10.x
The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c. Conflicts: src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala13
-rw-r--r--src/reflect/scala/reflect/internal/Types.scala15
2 files changed, 21 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 9dde952d25..60e50b517e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -222,8 +222,13 @@ trait Typers extends Modes with Adaptations with Tags {
new SubstWildcardMap(tparams).apply(tp)
case TypeRef(_, sym, _) if sym.isAliasType =>
val tp0 = tp.dealias
- val tp1 = dropExistential(tp0)
- if (tp1 eq tp0) tp else tp1
+ if (tp eq tp0) {
+ debugwarn(s"dropExistential did not progress dealiasing $tp, see SI-7126")
+ tp
+ } else {
+ val tp1 = dropExistential(tp0)
+ if (tp1 eq tp0) tp else tp1
+ }
case _ => tp
}
@@ -1818,7 +1823,9 @@ trait Typers extends Modes with Adaptations with Tags {
def pkgObjectWarning(m : Symbol, mdef : ModuleDef, restricted : String) = {
val pkgName = mdef.symbol.ownerChain find (_.isPackage) map (_.decodedName) getOrElse mdef.symbol.toString
- context.warning(if (m.pos.isDefined) m.pos else mdef.pos, s"${m} should be placed directly in package ${pkgName} instead of package object ${pkgName}. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.")
+ val pos = if (m.pos.isDefined) m.pos else mdef.pos
+ debugwarn(s"${m} should be placed directly in package ${pkgName} instead of package object ${pkgName}. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.")
+ debugwarn(pos.lineContent + (if (pos.isDefined) " " * (pos.column - 1) + "^" else ""))
}
}
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala
index 546df8a207..f5f577677c 100644
--- a/src/reflect/scala/reflect/internal/Types.scala
+++ b/src/reflect/scala/reflect/internal/Types.scala
@@ -3183,12 +3183,19 @@ trait Types extends api.Types { self: SymbolTable =>
* ?TC[?T] <: Any
* }}}
*/
- def unifySimple = (
- (params.isEmpty || tp.typeSymbol == NothingClass || tp.typeSymbol == AnyClass) && {
+ def unifySimple = {
+ val sym = tp.typeSymbol
+ if (sym == NothingClass || sym == AnyClass) { // kind-polymorphic
+ // SI-7126 if we register some type alias `T=Any`, we can later end
+ // with malformed types like `T[T]` during type inference in
+ // `handlePolymorphicCall`. No such problem if we register `Any`.
+ addBound(sym.tpe)
+ true
+ } else if (params.isEmpty) {
addBound(tp)
true
- }
- )
+ } else false
+ }
/** Full case: involving a check of the form
* {{{