Skip to content

Commit

Permalink
Don't show ObjectTpeJava upper bound in TypeBounds.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed May 13, 2019
1 parent 348a14c commit 0122f31
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ trait Types
case _ => lo <:< that && that <:< hi
}
private def emptyLowerBound = typeIsNothing(lo) || lo.isWildcard
private def emptyUpperBound = typeIsAny(hi) || hi.isWildcard
private def emptyUpperBound = typeIsAny(hi) || hi.eq(definitions.ObjectTpeJava) || hi.isWildcard
def isEmptyBounds = emptyLowerBound && emptyUpperBound

override def safeToString = scalaNotation(_.toString)
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/abstract-class-error.check
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
S.scala:1: error: class S needs to be abstract. Missing implementation for:
def g(y: Int, z: java.util.List): Int // inherited from class J
(Note that java.util.List does not match java.util.List[String]. To implement this raw type, use java.util.List[_ <: Object])
(Note that java.util.List does not match java.util.List[String]. To implement this raw type, use java.util.List[_])
class S extends J {
^
one error found
6 changes: 3 additions & 3 deletions test/files/neg/abstract-report2.check
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Missing implementations for 13 members. Stub implementations follow:
def removeAll(x$1: java.util.Collection[_]): Boolean = ???
def retainAll(x$1: java.util.Collection[_]): Boolean = ???
def size(): Int = ???
def toArray[T <: Object](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray[T](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray(): Array[Object] = ???

class Foo extends Collection[Int]
Expand All @@ -29,7 +29,7 @@ Missing implementations for 13 members. Stub implementations follow:
def removeAll(x$1: java.util.Collection[_]): Boolean = ???
def retainAll(x$1: java.util.Collection[_]): Boolean = ???
def size(): Int = ???
def toArray[T <: Object](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray[T](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray(): Array[Object] = ???

class Bar extends Collection[List[_ <: String]]
Expand All @@ -47,7 +47,7 @@ Missing implementations for 13 members. Stub implementations follow:
def removeAll(x$1: java.util.Collection[_]): Boolean = ???
def retainAll(x$1: java.util.Collection[_]): Boolean = ???
def size(): Int = ???
def toArray[T <: Object](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray[T](x$1: Array[T with Object]): Array[T with Object] = ???
def toArray(): Array[Object] = ???

class Baz[T] extends Collection[T]
Expand Down
6 changes: 3 additions & 3 deletions test/files/run/reflection-magicsymbols-invoke.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ method ##: ()Int
method ==: (x$1: Any)Boolean
method asInstanceOf: [T0]=> T0
method equals: (x$1: Any)Boolean
method getClass: ()Class[_ <: Object]
method getClass: ()Class[_]
method hashCode: ()Int
method isInstanceOf: [T0]=> Boolean
method toString: ()String
Expand Down Expand Up @@ -45,7 +45,7 @@ method clone: ()Object
method eq: (x$1: AnyRef)Boolean
method equals: (x$1: Object)Boolean
method finalize: ()Unit
method getClass: ()Class[_ <: Object]
method getClass: ()Class[_]
method hashCode: ()Int
method isInstanceOf: [T0]=> Boolean
method ne: (x$1: AnyRef)Boolean
Expand Down Expand Up @@ -91,7 +91,7 @@ method clone: ()Array[T]
method eq: (x$1: AnyRef)Boolean
method equals: (x$1: Object)Boolean
method finalize: ()Unit
method getClass: ()Class[_ <: Object]
method getClass: ()Class[_]
method hashCode: ()Int
method isInstanceOf: [T0]=> Boolean
method length: => Int
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t5072.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ scala> class C
defined class C

scala> Thread.currentThread.getContextClassLoader.loadClass(classOf[C].getName)
res0: Class[_ <: Object] = class C
res0: Class[_] = class C

scala> :quit

0 comments on commit 0122f31

Please sign in to comment.