Skip to content

Commit 2a0c890

Browse files
committed
Fix scala#3432: Make wait, notify and notifyAll final
1 parent 42577bb commit 2a0c890

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
path = scala-backend
33
url = https://github.com/lampepfl/scala.git
44
branch = sharing-backend
5-
[submodule "scala2-library"]
6-
path = scala2-library
7-
url = https://github.com/lampepfl/scala.git
8-
branch = dotty-library
95
[submodule "collection-strawman"]
106
path = collection-strawman
117
url = https://github.com/scala/collection-strawman.git

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ class Definitions {
277277
pt => MethodType(List(pt.paramRefs(0)), pt.paramRefs(0)), Final)
278278
lazy val Object_clone = enterMethod(ObjectClass, nme.clone_, MethodType(Nil, ObjectType), Protected)
279279
lazy val Object_finalize = enterMethod(ObjectClass, nme.finalize_, MethodType(Nil, UnitType), Protected)
280-
lazy val Object_notify = enterMethod(ObjectClass, nme.notify_, MethodType(Nil, UnitType))
281-
lazy val Object_notifyAll = enterMethod(ObjectClass, nme.notifyAll_, MethodType(Nil, UnitType))
282-
lazy val Object_wait = enterMethod(ObjectClass, nme.wait_, MethodType(Nil, UnitType))
283-
lazy val Object_waitL = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: Nil, UnitType))
284-
lazy val Object_waitLI = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: IntType :: Nil, UnitType))
280+
lazy val Object_notify = enterMethod(ObjectClass, nme.notify_, MethodType(Nil, UnitType), Final)
281+
lazy val Object_notifyAll = enterMethod(ObjectClass, nme.notifyAll_, MethodType(Nil, UnitType), Final)
282+
lazy val Object_wait = enterMethod(ObjectClass, nme.wait_, MethodType(Nil, UnitType), Final)
283+
lazy val Object_waitL = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: Nil, UnitType), Final)
284+
lazy val Object_waitLI = enterMethod(ObjectClass, nme.wait_, MethodType(LongType :: IntType :: Nil, UnitType), Final)
285285

286286
def ObjectMethods = List(Object_eq, Object_ne, Object_synchronized, Object_clone,
287287
Object_finalize, Object_notify, Object_notifyAll, Object_wait, Object_waitL, Object_waitLI)

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ object Build {
10991099
}
11001100

11011101
lazy val dottyProjectFolderChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
1102-
val submodules = List(new File("scala-backend"), new File("scala2-library"), new File("collection-strawman"))
1102+
val submodules = List(new File("scala-backend"), new File("collection-strawman"))
11031103
if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) {
11041104
sLog.value.log(Level.Error,
11051105
s"""Missing some of the submodules

scala2-library

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/neg/i3442.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Test {
2+
// Any
3+
override def getClass(): Class[_] = ??? // error
4+
override def ==(that: Any): Boolean = ??? // error
5+
override def != (that: Any): Boolean = ??? // error
6+
override def ##(): Int = ??? // error
7+
override def isInstanceOf[T0]: Boolean = ??? // error
8+
override def asInstanceOf[T0]: T0 = ??? // error
9+
10+
// AnyRef
11+
override def eq(that: AnyRef): Boolean = ??? // error
12+
override def ne(that: AnyRef): Boolean = ??? // error
13+
override def notify(): Unit = ??? // error
14+
override def notifyAll(): Unit = ??? // error
15+
override def wait(): Unit = ??? // error
16+
override def wait(timeout: Long, nanos: Int): Unit = ??? // error
17+
override def wait(timeout: Long): Unit = ??? // error
18+
}

0 commit comments

Comments
 (0)