Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ class Definitions {
pt => MethodType(List(pt.paramRefs(0)), pt.paramRefs(0)), Final)
lazy val Object_clone = enterMethod(ObjectClass, nme.clone_, MethodType(Nil, ObjectType), Protected)
lazy val Object_finalize = enterMethod(ObjectClass, nme.finalize_, MethodType(Nil, UnitType), Protected)
lazy val Object_notify = enterMethod(ObjectClass, nme.notify_, MethodType(Nil, UnitType))
lazy val Object_notifyAll = enterMethod(ObjectClass, nme.notifyAll_, MethodType(Nil, UnitType))
lazy val Object_wait = enterMethod(ObjectClass, nme.wait_, MethodType(Nil, UnitType))
lazy val Object_waitL = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: Nil, UnitType))
lazy val Object_waitLI = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: IntType :: Nil, UnitType))
lazy val Object_notify = enterMethod(ObjectClass, nme.notify_, MethodType(Nil, UnitType), Final)
lazy val Object_notifyAll = enterMethod(ObjectClass, nme.notifyAll_, MethodType(Nil, UnitType), Final)
lazy val Object_wait = enterMethod(ObjectClass, nme.wait_, MethodType(Nil, UnitType), Final)
lazy val Object_waitL = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: Nil, UnitType), Final)
lazy val Object_waitLI = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: IntType :: Nil, UnitType), Final)

def ObjectMethods = List(Object_eq, Object_ne, Object_synchronized, Object_clone,
Object_finalize, Object_notify, Object_notifyAll, Object_wait, Object_waitL, Object_waitLI)
Expand Down
18 changes: 18 additions & 0 deletions tests/neg/i3442.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Test {
// Any
override def getClass(): Class[_] = ??? // error
override def ==(that: Any): Boolean = ??? // error
override def != (that: Any): Boolean = ??? // error
override def ##(): Int = ??? // error
override def isInstanceOf[T0]: Boolean = ??? // error
override def asInstanceOf[T0]: T0 = ??? // error

// AnyRef
override def eq(that: AnyRef): Boolean = ??? // error
override def ne(that: AnyRef): Boolean = ??? // error
override def notify(): Unit = ??? // error
override def notifyAll(): Unit = ??? // error
override def wait(): Unit = ??? // error
override def wait(timeout: Long, nanos: Int): Unit = ??? // error
override def wait(timeout: Long): Unit = ??? // error
}