diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-05-17 16:35:20 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-05-17 16:35:20 -0700 |
commit | a23c7e295e0c36998ef84ca5247fc5a948d29af9 (patch) | |
tree | 634f8e7c5118bd44147cd034d761f7cfe11f43c4 /src | |
parent | 16ca3899d1a99e52952a395480e8a8f5960d14d5 (diff) | |
parent | f81a4f92967a2dd69784864e9ab9e1624d7db35b (diff) | |
download | scala-a23c7e295e0c36998ef84ca5247fc5a948d29af9.tar.gz scala-a23c7e295e0c36998ef84ca5247fc5a948d29af9.tar.bz2 scala-a23c7e295e0c36998ef84ca5247fc5a948d29af9.zip |
Merge 2.10.x into master
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Implicits.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
Diffstat (limited to 'src')
-rw-r--r-- | src/build/maven/scala-actors-pom.xml | 3 | ||||
-rw-r--r-- | src/build/maven/scala-library-pom.xml | 3 | ||||
-rw-r--r-- | src/build/maven/scala-reflect-pom.xml | 4 | ||||
-rw-r--r-- | src/build/maven/scala-swing-pom.xml | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 10 | ||||
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/Settings.scala | 5 | ||||
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala | 34 |
7 files changed, 45 insertions, 17 deletions
diff --git a/src/build/maven/scala-actors-pom.xml b/src/build/maven/scala-actors-pom.xml index e8c6649721..3d37ef8174 100644 --- a/src/build/maven/scala-actors-pom.xml +++ b/src/build/maven/scala-actors-pom.xml @@ -30,6 +30,9 @@ <system>JIRA</system> <url>https://issues.scala-lang.org/</url> </issueManagement> + <properties> + <info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL> + </properties> <dependencies> <dependency> <groupId>org.scala-lang</groupId> diff --git a/src/build/maven/scala-library-pom.xml b/src/build/maven/scala-library-pom.xml index d1192b2dd8..fc9964ae92 100644 --- a/src/build/maven/scala-library-pom.xml +++ b/src/build/maven/scala-library-pom.xml @@ -30,6 +30,9 @@ <system>JIRA</system> <url>https://issues.scala-lang.org/</url> </issueManagement> + <properties> + <info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL> + </properties> <dependencies> <!--<dependency> <groupId>com.typesafe</groupId> diff --git a/src/build/maven/scala-reflect-pom.xml b/src/build/maven/scala-reflect-pom.xml index 7a1613f42c..56d2ffc57c 100644 --- a/src/build/maven/scala-reflect-pom.xml +++ b/src/build/maven/scala-reflect-pom.xml @@ -30,7 +30,9 @@ <system>JIRA</system> <url>https://issues.scala-lang.org/</url> </issueManagement> - + <properties> + <info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL> + </properties> <dependencies> <dependency> <groupId>org.scala-lang</groupId> diff --git a/src/build/maven/scala-swing-pom.xml b/src/build/maven/scala-swing-pom.xml index 3df5db5b21..5099fe11dc 100644 --- a/src/build/maven/scala-swing-pom.xml +++ b/src/build/maven/scala-swing-pom.xml @@ -30,6 +30,9 @@ <system>JIRA</system> <url>https://issues.scala-lang.org/</url> </issueManagement> + <properties> + <info.apiURL>http://www.scala-lang.org/api/@VERSION@/</info.apiURL> + </properties> <dependencies> <dependency> <groupId>org.scala-lang</groupId> diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 4acda12dc0..37257b4f4e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -929,11 +929,15 @@ trait Implicits { */ if (DivergentImplicitRecovery.sym != null) { DivergingImplicitExpansionError(tree, pt, DivergentImplicitRecovery.sym)(context) - } else invalidImplicits take 1 foreach { sym => - def isSensibleAddendum = pt match { + } + else if (invalidImplicits.nonEmpty) { + val sym = invalidImplicits.head + // We don't even dare look if errors are being buffered + // !sym.hasFlag(LOCKED) is a hail mary between SI-2206 and SI-7486 + def isSensibleAddendum = !sym.hasFlag(LOCKED) && (pt match { case Function1(_, out) => out <:< sym.tpe.finalResultType case _ => pt <:< sym.tpe.finalResultType - } + }) // Don't pitch in with this theory unless it looks plausible that the // implicit would have helped setAddendum(pos, () => diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index e16b6be853..e5dbaa3fd5 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -238,10 +238,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_)) } } - def appendIndex(url: String): String = { - val index = "/index.html" - if (url.endsWith(index)) url else url + index - } + def appendIndex(url: String): String = url.stripSuffix("index.html").stripSuffix("/") + "/index.html" lazy val extUrlMapping: Map[String, String] = docExternalDoc.value flatMap { s => val idx = s.indexOf("#") diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala index ebac25bbe4..87d7ece8f2 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala @@ -116,18 +116,27 @@ trait DiagramFactory extends DiagramDirectiveParser { case d: TemplateEntity if ((!diagramFilter.hideInheritedNodes) || (d.inTemplate == pack)) => d } + def listSuperClasses(member: MemberTemplateImpl) = { + // TODO: Everyone should be able to use the @{inherit,content}Diagram annotation to add nodes to diagrams. + (pack.sym, member.sym) match { + case (ScalaPackage, NullClass) => + List(makeTemplate(AnyRefClass)) + case (ScalaPackage, NothingClass) => + (List(NullClass) ::: ScalaValueClasses) map { makeTemplate(_) } + case _ => + member.parentTypes map { + case (template, tpe) => template + } filter { + nodesAll.contains(_) + } + } + } + // for each node, add its subclasses for (node <- nodesAll if !classExcluded(node)) { node match { case dnode: MemberTemplateImpl => - var superClasses = dnode.parentTypes.map(_._1).filter(nodesAll.contains(_)) - - // TODO: Everyone should be able to use the @{inherit,content}Diagram annotation to add nodes to diagrams. - if (pack.sym == ScalaPackage) - if (dnode.sym == NullClass) - superClasses = List(makeTemplate(AnyRefClass)) - else if (dnode.sym == NothingClass) - superClasses = (List(NullClass) ::: ScalaValueClasses).map(makeTemplate(_)) + val superClasses = listSuperClasses(dnode) if (!superClasses.isEmpty) { nodesShown += dnode @@ -149,7 +158,14 @@ trait DiagramFactory extends DiagramDirectiveParser { None else { val nodes = nodesAll.filter(nodesShown.contains(_)).flatMap(mapNodes.get(_)) - val edges = edgesAll.map(pair => (mapNodes(pair._1), pair._2.map(mapNodes(_)))).filterNot(pair => pair._2.isEmpty) + val edges = edgesAll.map { + case (entity, superClasses) => { + (mapNodes(entity), superClasses flatMap { mapNodes.get(_) }) + } + } filterNot { + case (node, superClassNodes) => superClassNodes.isEmpty + } + val diagram = // TODO: Everyone should be able to use the @{inherit,content}Diagram annotation to change the diagrams. if (pack.sym == ScalaPackage) { |