summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-08-30 16:26:05 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2016-09-01 22:38:05 +0200
commita980fded6806f83bebe2ced31ab1ed70926254b2 (patch)
treec8885e4db2ad68476eb45291043d2c306961f7ab /src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
parent505c723b1e0bc282bdfa9cfc41adf24573ed19ad (diff)
downloadscala-a980fded6806f83bebe2ced31ab1ed70926254b2.tar.gz
scala-a980fded6806f83bebe2ced31ab1ed70926254b2.tar.bz2
scala-a980fded6806f83bebe2ced31ab1ed70926254b2.zip
SD-143 error for super calls that cannot be implemented correctly
If a call super[T].m resolves to a method A.m where A is a class, but not the direct superclass of the current class, there is no way to emit an invocation of A.m: `invokespecial A.m` will resolve to B.m where B is the superclass of the current class. This commit adds an error message in this case. Note that this is similar to an existing error message for qualified super calls to a non-direct superclass: class A { def m = 1 } class B extends A { override def m = 2 } class C extends B { override def m = super[A].m } Gives "error: A does not name a parent class of class C". If the user means to call method m in the superclass, he can write an unqualified `super.m`. An similar error message is introduced if A is a Java-defined interface (and m is a default method), and A is not a direct parent of the current class. In this case `invokespecial A.m` is invalid bytecode. The solution is to add A as a direct parent of the current class.
Diffstat (limited to 'src/reflect/scala/reflect/runtime/JavaUniverseForce.scala')
0 files changed, 0 insertions, 0 deletions