diff --git a/compile/api/SameAPI.scala b/compile/api/SameAPI.scala index c363eaeb9..5d0d87c2e 100644 --- a/compile/api/SameAPI.scala +++ b/compile/api/SameAPI.scala @@ -325,7 +325,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) sameTypeParameters(a.parameters, b.parameters) && sameType(a.baseType, b.baseType) def sameAnnotatedType(a: Annotated, b: Annotated): Boolean = - sameSimpleType(a.baseType, b.baseType) && + sameType(a.baseType, b.baseType) && sameAnnotations(a.annotations, b.annotations) def sameStructure(a: Structure, b: Structure): Boolean = samePending(a,b)(sameStructureDirect) diff --git a/compile/interface/API.scala b/compile/interface/API.scala index 3a5e9c2b1..767b273e6 100644 --- a/compile/interface/API.scala +++ b/compile/interface/API.scala @@ -134,7 +134,7 @@ final class API(val global: CallbackGlobal) extends Compat if(a.assocs.isEmpty) Array(new xsbti.api.AnnotationArgument("", a.args.mkString("(", ",", ")"))) // what else to do with a Tree? else a.assocs.map { case (name, value) => new xsbti.api.AnnotationArgument(name.toString, value.toString) }.toArray[xsbti.api.AnnotationArgument] ) - private def annotated(in: Symbol, as: List[AnnotationInfo], tpe: Type) = new xsbti.api.Annotated(simpleType(in, tpe), annotations(in, as)) + private def annotated(in: Symbol, as: List[AnnotationInfo], tpe: Type) = new xsbti.api.Annotated(processType(in, tpe), annotations(in, as)) private def viewer(s: Symbol) = (if(s.isModule) s.moduleClass else s).thisType private def printMember(label: String, in: Symbol, t: Type) = println(label + " in " + in + " : " + t + " (debug: " + debugString(t) + " )") diff --git a/compile/persist/APIFormats.scala b/compile/persist/APIFormats.scala index 441b1b266..e9db50ac0 100644 --- a/compile/persist/APIFormats.scala +++ b/compile/persist/APIFormats.scala @@ -50,7 +50,7 @@ trait APIFormats extends FormatExtra implicit def formatSource(implicit pa: Format[Array[Package]], da: Format[Array[Definition]]): Format[SourceAPI] = p2( (s: SourceAPI) => (s.packages, s.definitions))( (p, d) => new SourceAPI(p, d) )(pa, da) - implicit def formatAnnotated(implicit t: Format[SimpleType], as: Format[Array[Annotation]]): Format[Annotated] = + implicit def formatAnnotated(implicit t: Format[Type], as: Format[Array[Annotation]]): Format[Annotated] = p2( (a: Annotated) => (a.baseType,a.annotations))(new Annotated(_,_))(t,as) implicit def formatPolymorphic(implicit t: Format[Type], tps: Format[Array[TypeParameter]]): Format[Polymorphic] = diff --git a/interface/type b/interface/type index ac0926e92..dbb393dd6 100644 --- a/interface/type +++ b/interface/type @@ -16,7 +16,7 @@ Type baseType: Type value: String Annotated - baseType : SimpleType + baseType : Type annotations : Annotation* Structure parents : ~Type* diff --git a/sbt/src/sbt-test/source-dependencies/continuations/Foo.scala b/sbt/src/sbt-test/source-dependencies/continuations/Foo.scala new file mode 100644 index 000000000..580f7175a --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/Foo.scala @@ -0,0 +1,3 @@ +trait Foo +trait BarA +trait BarB \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/continuations/Use.scala b/sbt/src/sbt-test/source-dependencies/continuations/Use.scala new file mode 100644 index 000000000..bdb848464 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/Use.scala @@ -0,0 +1,6 @@ +import scala.util.continuations._ + +class Use { + val a = new Baz + def bar: (Foo with BarA) @cpsParam[Unit, Unit] = a.foo +} diff --git a/sbt/src/sbt-test/source-dependencies/continuations/build.sbt b/sbt/src/sbt-test/source-dependencies/continuations/build.sbt new file mode 100644 index 000000000..b0f2eb814 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/build.sbt @@ -0,0 +1,7 @@ +autoCompilerPlugins := true + +addCompilerPlugin("org.scala-lang.plugins" % "continuations" % "2.9.2") + +scalaVersion := "2.9.2" + +scalacOptions += "-P:continuations:enable" \ No newline at end of file diff --git a/sbt/src/sbt-test/source-dependencies/continuations/changes/Def1.scala b/sbt/src/sbt-test/source-dependencies/continuations/changes/Def1.scala new file mode 100644 index 000000000..3cc76e193 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/changes/Def1.scala @@ -0,0 +1,5 @@ +import scala.util.continuations._ + +class Baz { + def foo = shiftUnit[Foo with BarA, Unit, Unit](null) +} diff --git a/sbt/src/sbt-test/source-dependencies/continuations/changes/Def2.scala b/sbt/src/sbt-test/source-dependencies/continuations/changes/Def2.scala new file mode 100644 index 000000000..9a176dffb --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/changes/Def2.scala @@ -0,0 +1,5 @@ +import scala.util.continuations._ + +class Baz { + def foo = shiftUnit[Foo with BarB, Unit, Unit](null) +} diff --git a/sbt/src/sbt-test/source-dependencies/continuations/test b/sbt/src/sbt-test/source-dependencies/continuations/test new file mode 100644 index 000000000..2aeb714be --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/continuations/test @@ -0,0 +1,10 @@ +# Compile code with a type (Foo with BarA) @cpsParam... +# The spec says only simple types can be annotated, but scalac allows any type. +$ copy-file changes/Def1.scala Def.scala +> compile + +# To ensure it was properly processed, change it to (Foo with BarB) @cpsParam... +# This should invalidate Use.scala, which expects it to be BarA and so compilation should fail. +$ delete Def.scala +$ copy-file changes/Def2.scala Def.scala +-> compile \ No newline at end of file