summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-09-17 16:18:31 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-09-17 16:18:31 +1000
commit01103764ef576395dc6201d1d2b5a700a28bdd2a (patch)
tree278005d7e09acb9e178236144747406bfd38c729 /src/reflect
parent7719a3cc908464d34d602a7a5a23e943059bb714 (diff)
parent224efebaf17e2bb91bd89348f63bb0905dc72288 (diff)
downloadscala-01103764ef576395dc6201d1d2b5a700a28bdd2a.tar.gz
scala-01103764ef576395dc6201d1d2b5a700a28bdd2a.tar.bz2
scala-01103764ef576395dc6201d1d2b5a700a28bdd2a.zip
Merge remote-tracking branch 'origin/2.11.x' into topic/completely-2.11
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/ClassfileConstants.scala2
-rw-r--r--src/reflect/scala/reflect/internal/Trees.scala2
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala2
-rw-r--r--src/reflect/scala/reflect/internal/tpe/TypeMaps.scala2
-rw-r--r--src/reflect/scala/reflect/internal/transform/UnCurry.scala22
-rw-r--r--src/reflect/scala/reflect/macros/blackbox/Context.scala2
-rw-r--r--src/reflect/scala/reflect/macros/package.scala4
-rw-r--r--src/reflect/scala/reflect/macros/whitebox/Context.scala2
-rw-r--r--src/reflect/scala/reflect/runtime/JavaUniverseForce.scala2
9 files changed, 24 insertions, 16 deletions
diff --git a/src/reflect/scala/reflect/internal/ClassfileConstants.scala b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
index e5d97e8959..a4223c1cb5 100644
--- a/src/reflect/scala/reflect/internal/ClassfileConstants.scala
+++ b/src/reflect/scala/reflect/internal/ClassfileConstants.scala
@@ -14,7 +14,7 @@ object ClassfileConstants {
final val JAVA_MAJOR_VERSION = 45
final val JAVA_MINOR_VERSION = 3
- /** (see http://java.sun.com/docs/books/jvms/second_edition/jvms-clarify.html)
+ /** (see http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.1)
*
* If the `ACC_INTERFACE` flag is set, the `ACC_ABSTRACT` flag must also
* be set (ch. 2.13.1).
diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala
index 498e7bddd0..bbd9df05d2 100644
--- a/src/reflect/scala/reflect/internal/Trees.scala
+++ b/src/reflect/scala/reflect/internal/Trees.scala
@@ -1418,7 +1418,7 @@ trait Trees extends api.Trees {
transformTypeDefs(tparams), transform(rhs))
}
case LabelDef(name, params, rhs) =>
- treeCopy.LabelDef(tree, name, transformIdents(params), transform(rhs)) //bq: Martin, once, atOwner(...) works, also change `LamdaLifter.proxy'
+ treeCopy.LabelDef(tree, name, transformIdents(params), transform(rhs)) //bq: Martin, once, atOwner(...) works, also change `LambdaLifter.proxy'
case PackageDef(pid, stats) =>
treeCopy.PackageDef(
tree, transform(pid).asInstanceOf[RefTree],
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index c40f5be476..a9020a3d4c 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -244,7 +244,7 @@ abstract class UnPickler {
(module map { case (group, art) =>
s"""\n(NOTE: It looks like the $art module is missing; try adding a dependency on "$group" : "$art".
- | See http://docs.scala-lang.org/overviews/core/scala-2.11.html for more information.)""".stripMargin
+ | See http://docs.scala-lang.org/overviews/ for more information.)""".stripMargin
} getOrElse "")
}
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
index 817c9706b4..b8d4050d7d 100644
--- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
+++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala
@@ -343,7 +343,7 @@ private[internal] trait TypeMaps {
object rawToExistentialInJava extends TypeMap {
def apply(tp: Type): Type = tp match {
// any symbol that occurs in a java sig, not just java symbols
- // see http://lampsvn.epfl.ch/trac/scala/ticket/2454#comment:14
+ // see https://issues.scala-lang.org/browse/SI-2454?focusedCommentId=46618
case TypeRef(pre, sym, List()) if !sym.typeParams.isEmpty =>
val eparams = typeParamsToExistentials(sym, sym.typeParams)
existentialAbstraction(eparams, TypeRef(pre, sym, eparams map (_.tpe)))
diff --git a/src/reflect/scala/reflect/internal/transform/UnCurry.scala b/src/reflect/scala/reflect/internal/transform/UnCurry.scala
index abea8bed9f..85e3ac60e8 100644
--- a/src/reflect/scala/reflect/internal/transform/UnCurry.scala
+++ b/src/reflect/scala/reflect/internal/transform/UnCurry.scala
@@ -40,19 +40,27 @@ trait UnCurry {
apply(MethodType(h.cloneSymbol.resetFlag(IMPLICIT) :: t, restpe))
case NullaryMethodType(restpe) =>
apply(MethodType(List(), restpe))
- case TypeRef(pre, ByNameParamClass, arg :: Nil) =>
- apply(functionType(List(), arg))
- case TypeRef(pre, RepeatedParamClass, arg :: Nil) =>
- apply(seqType(arg))
- case TypeRef(pre, JavaRepeatedParamClass, arg :: Nil) =>
- apply(arrayType(
- if (isUnboundedGeneric(arg)) ObjectTpe else arg))
+ case DesugaredParameterType(desugaredTpe) =>
+ apply(desugaredTpe)
case _ =>
expandAlias(mapOver(tp))
}
}
}
+ object DesugaredParameterType {
+ def unapply(tpe: Type): Option[Type] = tpe match {
+ case TypeRef(pre, ByNameParamClass, arg :: Nil) =>
+ Some(functionType(List(), arg))
+ case TypeRef(pre, RepeatedParamClass, arg :: Nil) =>
+ Some(seqType(arg))
+ case TypeRef(pre, JavaRepeatedParamClass, arg :: Nil) =>
+ Some(arrayType(if (isUnboundedGeneric(arg)) ObjectTpe else arg))
+ case _ =>
+ None
+ }
+ }
+
private val uncurryType = new TypeMap {
def apply(tp0: Type): Type = {
val tp = expandAlias(tp0)
diff --git a/src/reflect/scala/reflect/macros/blackbox/Context.scala b/src/reflect/scala/reflect/macros/blackbox/Context.scala
index 2f9c512efa..ce28b5911e 100644
--- a/src/reflect/scala/reflect/macros/blackbox/Context.scala
+++ b/src/reflect/scala/reflect/macros/blackbox/Context.scala
@@ -29,7 +29,7 @@ package blackbox
* which means that its expansion will be upcast to its return type, enforcing faithfullness of that macro to its
* type signature. Whitebox macros, i.e. the ones defined with `whitebox.Context`, aren't bound by this restriction,
* which enables a number of important use cases, but they are also going to enjoy less support than blackbox macros,
- * so choose wisely. See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] for more information.
+ * so choose wisely. See the [[http://docs.scala-lang.org/overviews/macros/overview.html Macros Guide]] for more information.
*
* @see `scala.reflect.macros.whitebox.Context`
*/
diff --git a/src/reflect/scala/reflect/macros/package.scala b/src/reflect/scala/reflect/macros/package.scala
index cc7111d794..b63d419d61 100644
--- a/src/reflect/scala/reflect/macros/package.scala
+++ b/src/reflect/scala/reflect/macros/package.scala
@@ -10,14 +10,14 @@ package reflect
* Within these functions the programmer has access to compiler APIs.
* For example, it is possible to generate, analyze and typecheck code.
*
- * See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] on how to get started with Scala macros.
+ * See the [[http://docs.scala-lang.org/overviews/macros/overview.html Macros Guide]] on how to get started with Scala macros.
*/
package object macros {
/** The Scala macros context.
*
* In Scala 2.11, macros that were once the one are split into blackbox and whitebox macros,
* with the former being better supported and the latter being more powerful. You can read about
- * the details of the split and the associated trade-offs in the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]].
+ * the details of the split and the associated trade-offs in the [[http://docs.scala-lang.org/overviews/macros/overview.html Macros Guide]].
*
* `scala.reflect.macros.Context` follows this tendency and turns into `scala.reflect.macros.blackbox.Context`
* and `scala.reflect.macros.whitebox.Context`. The original `Context` is left in place for compatibility reasons,
diff --git a/src/reflect/scala/reflect/macros/whitebox/Context.scala b/src/reflect/scala/reflect/macros/whitebox/Context.scala
index bd48df46cc..272991cba9 100644
--- a/src/reflect/scala/reflect/macros/whitebox/Context.scala
+++ b/src/reflect/scala/reflect/macros/whitebox/Context.scala
@@ -29,7 +29,7 @@ package whitebox
* gaining the ability to refine the type of its expansion beyond its official return type, which enables a number of important use cases.
* Blackbox macros, i.e. the ones defined with `blackbox.Context`, can't do that, so they are less powerful.
* However blackbox macros are also going to enjoy better support than whitebox macros, so choose wisely.
- * See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] for more information.
+ * See the [[http://docs.scala-lang.org/overviews/macros/overview.html Macros Guide]] for more information.
*
* @see `scala.reflect.macros.blackbox.Context`
*/
diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
index ea213cadd9..5477bdd6d4 100644
--- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
+++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
@@ -444,7 +444,7 @@ trait JavaUniverseForce { self: runtime.JavaUniverse =>
definitions.ScalaValueClassesNoUnit
definitions.ScalaValueClasses
-
+ uncurry.DesugaredParameterType
erasure.GenericArray
erasure.scalaErasure
erasure.specialScalaErasure