diff options
23 files changed, 180 insertions, 163 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/Settings.scala b/src/compiler/scala/tools/nsc/doc/Settings.scala index 02630a99b2..8c0628c073 100644 --- a/src/compiler/scala/tools/nsc/doc/Settings.scala +++ b/src/compiler/scala/tools/nsc/doc/Settings.scala @@ -249,10 +249,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" // Deprecated together with 'docExternalUrls' option. lazy val extUrlPackageMapping: Map[String, String] = (Map.empty[String, String] /: docExternalUrls.value) { diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js index 70073b272a..96689ae701 100644 --- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js +++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js @@ -14,9 +14,9 @@ var title = $(document).attr('title'); var lastHash = ""; $(document).ready(function() { - $('body').layout({ + $('body').layout({ west__size: '20%', - center__maskContents: true + center__maskContents: true }); $('#browser').layout({ center__paneSelector: ".ui-west-center" @@ -342,11 +342,6 @@ function configureTextFilter() { if (event.keyCode == 27) { // escape input.attr("value", ""); } - if (event.keyCode == 9) { // tab - $("#template").contents().find("#mbrsel-input").focus(); - input.attr("value", ""); - return false; - } if (event.keyCode == 40) { // down arrow $(window).unbind("keydown"); keyboardScrolldownLeftPane(); @@ -354,6 +349,14 @@ function configureTextFilter() { } textFilter(); }); + input.bind('keydown', function(event) { + if (event.keyCode == 9) { // tab + $("#template").contents().find("#mbrsel-input").focus(); + input.attr("value", ""); + return false; + } + textFilter(); + }); input.focus(function(event) { input.select(); }); }); scheduler.add("init", function() { diff --git a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala index 175b4a6472..cb54a739bf 100644 --- a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala @@ -117,18 +117,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 @@ -150,7 +159,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) { diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index e0dbe98780..b9cff5b2d3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -1307,6 +1307,11 @@ trait ContextErrors { throw MacroBodyTypecheckException // don't call fail, because we don't need IS_ERROR } + def MacroDefIsQmarkQmarkQmark() = { + macroLogVerbose("typecheck terminated unexpectedly: macro is ???") + throw MacroBodyTypecheckException + } + def MacroFeatureNotEnabled() = { macroLogVerbose("typecheck terminated unexpectedly: language.experimental.macros feature is not enabled") fail() diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 193e589470..ef87a32c1d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -996,12 +996,15 @@ trait Implicits { if (divergence || DivergentImplicitRecovery.sym != null) { if (settings.Xdivergence211.value) DivergingImplicitExpansionError(tree, pt, DivergentImplicitRecovery.sym)(context) else throw DivergentImplicit - } 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 tp => tp <:< sym.tpe.finalResultType - case _ => false - } + 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/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index 5ad568b1e6..816f977890 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -412,6 +412,9 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { // Phase II: typecheck the right-hand side of the macro def val typed = typecheckRhs(macroDdef.rhs) typed match { + case MacroImplReference(_, meth, _) if meth == Predef_??? => + bindMacroImpl(macroDef, typed) + MacroDefIsQmarkQmarkQmark() case MacroImplReference(owner, meth, targs) => if (!meth.isMethod) MacroDefInvalidBodyError() if (!meth.isPublic) MacroImplNotPublicError() @@ -521,26 +524,30 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { val methName = binding.methName macroLogVerbose(s"resolved implementation as $className.$methName") - // I don't use Scala reflection here, because it seems to interfere with JIT magic - // whenever you instantiate a mirror (and not do anything with in, just instantiate), performance drops by 15-20% - // I'm not sure what's the reason - for me it's pure voodoo - // upd. my latest experiments show that everything's okay - // it seems that in 2.10.1 we can easily switch to Scala reflection - try { - macroLogVerbose(s"loading implementation class: $className") - macroLogVerbose(s"classloader is: ${ReflectionUtils.show(macroClassloader)}") - val implObj = ReflectionUtils.staticSingletonInstance(macroClassloader, className) - // relies on the fact that macro impls cannot be overloaded - // so every methName can resolve to at maximum one method - val implMeths = implObj.getClass.getDeclaredMethods.find(_.getName == methName) - val implMeth = implMeths getOrElse { throw new NoSuchMethodException(s"$className.$methName") } - macroLogVerbose(s"successfully loaded macro impl as ($implObj, $implMeth)") - args => implMeth.invoke(implObj, ((args.c +: args.others) map (_.asInstanceOf[AnyRef])): _*) - } catch { - case ex: Exception => - macroLogVerbose(s"macro runtime failed to load: ${ex.toString}") - macroDef setFlag IS_ERROR - null + if (binding.className == Predef_???.owner.fullName.toString && binding.methName == Predef_???.name.encoded) { + args => throw new AbortMacroException(args.c.enclosingPosition, "macro implementation is missing") + } else { + // I don't use Scala reflection here, because it seems to interfere with JIT magic + // whenever you instantiate a mirror (and not do anything with in, just instantiate), performance drops by 15-20% + // I'm not sure what's the reason - for me it's pure voodoo + // upd. my latest experiments show that everything's okay + // it seems that in 2.10.1 we can easily switch to Scala reflection + try { + macroLogVerbose(s"loading implementation class: $className") + macroLogVerbose(s"classloader is: ${ReflectionUtils.show(macroClassloader)}") + val implObj = ReflectionUtils.staticSingletonInstance(macroClassloader, className) + // relies on the fact that macro impls cannot be overloaded + // so every methName can resolve to at maximum one method + val implMeths = implObj.getClass.getDeclaredMethods.find(_.getName == methName) + val implMeth = implMeths getOrElse { throw new NoSuchMethodException(s"$className.$methName") } + macroLogVerbose(s"successfully loaded macro impl as ($implObj, $implMeth)") + args => implMeth.invoke(implObj, ((args.c +: args.others) map (_.asInstanceOf[AnyRef])): _*) + } catch { + case ex: Exception => + macroLogVerbose(s"macro runtime failed to load: ${ex.toString}") + macroDef setFlag IS_ERROR + null + } } }) } diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index fa72ad64bf..bad49385aa 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -80,32 +80,11 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT private def transformArgs(params: List[Symbol], args: List[Tree]) = { treeInfo.mapMethodParamsAndArgs(params, args) { (param, arg) => if (isByNameParamType(param.tpe)) - withInvalidOwner { checkPackedConforms(transform(arg), param.tpe.typeArgs.head) } + withInvalidOwner(transform(arg)) else transform(arg) } } - private def checkPackedConforms(tree: Tree, pt: Type): Tree = { - def typeError(typer: analyzer.Typer, pos: Position, found: Type, req: Type) { - if (!found.isErroneous && !req.isErroneous) { - val msg = analyzer.ErrorUtils.typeErrorMsg(found, req, typer.infer.isPossiblyMissingArgs(found, req)) - typer.context.error(pos, analyzer.withAddendum(pos)(msg)) - if (settings.explaintypes.value) - explainTypes(found, req) - } - } - - if (tree.tpe exists (_.typeSymbol.isExistentialSkolem)) { - val packed = localTyper.packedType(tree, NoSymbol) - if (!(packed <:< pt)) { - val errorContext = localTyper.context.make(localTyper.context.tree) - errorContext.setReportErrors() - typeError(analyzer.newTyper(errorContext), tree.pos, packed, pt) - } - } - tree - } - /** Check that a class and its companion object to not both define * a class or module with same name */ diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index b89b570cd8..c59ef4ebda 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -5792,7 +5792,7 @@ trait Typers extends Modes with Adaptations with Tags { tree1 } - val isMacroBodyOkay = !tree.symbol.isErroneous && !(tree1 exists (_.isErroneous)) + val isMacroBodyOkay = !tree.symbol.isErroneous && !(tree1 exists (_.isErroneous)) && tree1 != EmptyTree val shouldInheritMacroImplReturnType = ddef.tpt.isEmpty if (isMacroBodyOkay && shouldInheritMacroImplReturnType) computeMacroDefTypeFromMacroImpl(ddef, tree1.symbol) else AnyClass.tpe } diff --git a/src/reflect/scala/reflect/api/Mirrors.scala b/src/reflect/scala/reflect/api/Mirrors.scala index d0d8a37584..76a75940ff 100644 --- a/src/reflect/scala/reflect/api/Mirrors.scala +++ b/src/reflect/scala/reflect/api/Mirrors.scala @@ -133,9 +133,7 @@ package api * scala> fmX.get * res0: Any = 2 * - * scala> fmX.set(3) - * scala.ScalaReflectionException: cannot set an immutable field x - * ... + * scala> fmX.set(3) // NOTE: can set an underlying value of an immutable field! * * scala> val fieldY = typeOf[C].declaration(newTermName("y")).asTerm.accessed.asTerm * fieldY: reflect.runtime.universe.TermSymbol = variable y diff --git a/src/reflect/scala/reflect/runtime/JavaMirrors.scala b/src/reflect/scala/reflect/runtime/JavaMirrors.scala index 3442e3d22e..ccc727451c 100644 --- a/src/reflect/scala/reflect/runtime/JavaMirrors.scala +++ b/src/reflect/scala/reflect/runtime/JavaMirrors.scala @@ -133,6 +133,7 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni sm"""Scala field ${sym.name} isn't represented as a Java field, neither it has a Java accessor method |note that private parameters of class constructors don't get mapped onto fields and/or accessors, |unless they are used outside of their declaring constructors.""") + @deprecated("corresponding check has been removed from FieldMirror.set, this method is also being phased out", "2.11.0") private def ErrorSetImmutableField(sym: Symbol) = throw new ScalaReflectionException(s"cannot set an immutable field ${sym.name}") private def ErrorNotConstructor(sym: Symbol, owner: Symbol) = throw new ScalaReflectionException(s"expected a constructor of $owner, you provided $sym") private def ErrorFree(member: Symbol, freeType: Symbol) = throw new ScalaReflectionException(s"cannot reflect ${member.kindString} ${member.name}, because it's a member of a weak type ${freeType.name}") @@ -282,9 +283,13 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni } def get = jfield.get(receiver) def set(value: Any) = { - if (!symbol.isMutable) ErrorSetImmutableField(symbol) + // it appears useful to be able to set values of vals, therefore I'm disabling this check + // if (!symbol.isMutable) ErrorSetImmutableField(symbol) jfield.set(receiver, value) } + // this dummy method is necessary to prevent the optimizer from stripping off ErrorSetImmutableField + // which would break binary compatibility with 2.10.0 + private def dummy(symbol: Symbol) = ErrorSetImmutableField(symbol) override def toString = s"field mirror for ${symbol.fullName} (bound to $receiver)" } @@ -687,7 +692,8 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni (if (jModifier.isStatic(mods)) module.moduleClass else clazz).info.decls enter sym for (jinner <- jclazz.getDeclaredClasses) { - enter(jclassAsScala(jinner, clazz), jinner.getModifiers) + jclassAsScala(jinner) // inner class is entered as a side-effect + // no need to call enter explicitly } pendingLoadActions = { () => @@ -1046,13 +1052,17 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni * @param jclazz The Java class * @return A Scala class symbol that wraps all reflection info of `jclazz` */ - private def jclassAsScala(jclazz: jClass[_]): Symbol = jclassAsScala(jclazz, sOwner(jclazz)) + private def jclassAsScala(jclazz: jClass[_]): Symbol = { + val clazz = sOwner(jclazz) // sOwner called outside of closure for binary compatibility + toScala(classCache, jclazz){ (mirror, jclazz) => + mirror.jclassAsScala(jclazz, clazz) + } + } private def jclassAsScala(jclazz: jClass[_], owner: Symbol): ClassSymbol = { - val name = scalaSimpleName(jclazz) - val completer = (clazz: Symbol, module: Symbol) => new FromJavaClassCompleter(clazz, module, jclazz) - val (clazz, module) = createClassModule(owner, name, completer) - classCache enter (jclazz, clazz) + val name = scalaSimpleName(jclazz) + val completer = (clazz: Symbol, module: Symbol) => new FromJavaClassCompleter(clazz, module, jclazz) + val (clazz, _) = createClassModule(owner, name, completer) clazz } diff --git a/test/files/neg/macro-qmarkqmarkqmark.check b/test/files/neg/macro-qmarkqmarkqmark.check new file mode 100644 index 0000000000..afd49e7d90 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.check @@ -0,0 +1,13 @@ +macro-qmarkqmarkqmark.scala:5: error: macro implementation is missing + foo1 + ^ +macro-qmarkqmarkqmark.scala:8: error: macros cannot be partially applied + foo2 + ^ +macro-qmarkqmarkqmark.scala:9: error: macro implementation is missing + foo2(1) + ^ +macro-qmarkqmarkqmark.scala:12: error: macro implementation is missing + foo3[Int] + ^ +four errors found diff --git a/test/files/neg/macro-qmarkqmarkqmark.scala b/test/files/neg/macro-qmarkqmarkqmark.scala new file mode 100644 index 0000000000..c8d8550fd8 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.scala @@ -0,0 +1,13 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + foo1 + + def foo2(x: Int) = macro ??? + foo2 + foo2(1) + + def foo3[T] = macro ??? + foo3[Int] +}
\ No newline at end of file diff --git a/test/files/pos/macro-qmarkqmarkqmark.check b/test/files/pos/macro-qmarkqmarkqmark.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/pos/macro-qmarkqmarkqmark.check diff --git a/test/files/pos/macro-qmarkqmarkqmark.scala b/test/files/pos/macro-qmarkqmarkqmark.scala new file mode 100644 index 0000000000..a91e4320b6 --- /dev/null +++ b/test/files/pos/macro-qmarkqmarkqmark.scala @@ -0,0 +1,7 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + def foo2(x: Int) = macro ??? + def foo3[T] = macro ??? +}
\ No newline at end of file diff --git a/test/files/pos/t5886.scala b/test/files/pos/t5886.scala new file mode 100644 index 0000000000..066187322d --- /dev/null +++ b/test/files/pos/t5886.scala @@ -0,0 +1,18 @@ +object A { + def f0[T](x: T): T = x + def f1[T](x: => T): T = x + def f2[T](x: () => T): T = x() + + f0(this.getClass) // ok + f1(this.getClass) + f2(this.getClass) // ok + + // a.scala:7: error: type mismatch; + // found : Class[_ <: A.type] + // required: Class[?0(in value x1)] where type ?0(in value x1) <: A.type + // Note: A.type >: ?0, but Java-defined class Class is invariant in type T. + // You may wish to investigate a wildcard type such as `_ >: ?0`. (SLS 3.2.10) + // val x1 = f1(this.getClass) + // ^ + // one error found +} diff --git a/test/files/pos/t7486.scala b/test/files/pos/t7486.scala new file mode 100644 index 0000000000..6dd7f4c4ac --- /dev/null +++ b/test/files/pos/t7486.scala @@ -0,0 +1,8 @@ +object Test{ + var locker = 0 + // remove implicit, or change to `locker = locker + 1` to make it compile. + implicit val davyJones0 = { + locker += 0 + 0 + } +} diff --git a/test/files/run/reflection-fieldmirror-getsetval.check b/test/files/run/reflection-fieldmirror-getsetval.check index 82fef37c25..1e959a9900 100644 --- a/test/files/run/reflection-fieldmirror-getsetval.check +++ b/test/files/run/reflection-fieldmirror-getsetval.check @@ -1,2 +1,2 @@ 42 -cannot set an immutable field x +2 diff --git a/test/files/run/reflection-fieldmirror-getsetval.scala b/test/files/run/reflection-fieldmirror-getsetval.scala index 67c54d9708..90221481d4 100644 --- a/test/files/run/reflection-fieldmirror-getsetval.scala +++ b/test/files/run/reflection-fieldmirror-getsetval.scala @@ -12,13 +12,7 @@ object Test extends App { val cs = im.symbol val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm val fm: FieldMirror = im.reflectField(f) - try { - println(fm.get) - fm.set(2) - println(fm.get) - println("this indicates a failure") - } catch { - case ex: Throwable => - println(ex.getMessage) - } + println(fm.get) + fm.set(2) + println(fm.get) } diff --git a/test/files/run/t6989.check b/test/files/run/t6989.check index 3a94f6e8df..8943792115 100644 --- a/test/files/run/t6989.check +++ b/test/files/run/t6989.check @@ -113,18 +113,6 @@ isProtected = false isPublic = false privateWithin = <none> ============ -sym = class $PrivateJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $PrivateJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 isPrivate = false isProtected = true @@ -143,18 +131,6 @@ isProtected = false isPublic = false privateWithin = package foo ============ -sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = true -isPublic = false -privateWithin = package foo -============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $ProtectedJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 isPrivate = false isProtected = false @@ -179,97 +155,55 @@ isProtected = false isPublic = true privateWithin = <none> ============ -sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = constructor $PublicJavaClass, signature = (x$1: foo.JavaClass_1)JavaClass_1.this.$PublicJavaClass, owner = class $PublicJavaClass +sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1 isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $PublicJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ -sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1 +sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = object PrivateStaticJavaClass, signature = JavaClass_1.this.PrivateStaticJavaClass.type, owner = class JavaClass_1 +sym = object PrivateStaticJavaClass, signature = foo.JavaClass_1.PrivateStaticJavaClass.type, owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = object ProtectedStaticJavaClass, signature = JavaClass_1.this.ProtectedStaticJavaClass.type, owner = class JavaClass_1 +sym = object ProtectedStaticJavaClass, signature = foo.JavaClass_1.ProtectedStaticJavaClass.type, owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = object PublicStaticJavaClass, signature = JavaClass_1.this.PublicStaticJavaClass.type, owner = class JavaClass_1 +sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = constructor PublicStaticJavaClass, signature = ()foo.JavaClass_1.PublicStaticJavaClass, owner = class PublicStaticJavaClass isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass +sym = object PublicStaticJavaClass, signature = foo.JavaClass_1.PublicStaticJavaClass.type, owner = object JavaClass_1 isPrivate = false isProtected = false isPublic = true diff --git a/test/files/run/t6989/JavaClass_1.java b/test/files/run/t6989/JavaClass_1.java index eb26a08700..72ec4d6ab6 100644 --- a/test/files/run/t6989/JavaClass_1.java +++ b/test/files/run/t6989/JavaClass_1.java @@ -7,6 +7,8 @@ package foo; // I'm leaving the incorrect results of FromJavaClassCompleters in the check // file, so that we get notified when something changes there. +// ^^^ It's not clear what those incorrect results were, but the fix for SI-7359 +// (backport of fix for SI-6548) has probably resolved some of these. OP, please revisit this comment. class PackagePrivateJavaClass { private int privateField = 0; diff --git a/test/files/run/t7359.check b/test/files/run/t7359.check new file mode 100644 index 0000000000..9766475a41 --- /dev/null +++ b/test/files/run/t7359.check @@ -0,0 +1 @@ +ok diff --git a/test/files/run/t7359/Cyclic_1.java b/test/files/run/t7359/Cyclic_1.java new file mode 100644 index 0000000000..42b46c1aed --- /dev/null +++ b/test/files/run/t7359/Cyclic_1.java @@ -0,0 +1,3 @@ +abstract class Cyclic { + static interface Inner<T extends Inner> { } +}
\ No newline at end of file diff --git a/test/files/run/t7359/Test_2.scala b/test/files/run/t7359/Test_2.scala new file mode 100644 index 0000000000..bb6f4cb2d9 --- /dev/null +++ b/test/files/run/t7359/Test_2.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + typeOf[Cyclic].members + println("ok") +}
\ No newline at end of file |