@@ -246,17 +246,6 @@ class Definitions {
246
246
* - Have other methods exist only in Object.
247
247
* To achieve this, we synthesize all Any and Object methods; Object methods no longer get
248
248
* loaded from a classfile.
249
- *
250
- * There's a remaining question about `getClass`. In Scala2.x `getClass` was handled by compiler magic.
251
- * This is deemed too cumersome for Dotty and therefore right now `getClass` gets no special treatment;
252
- * it's just a method on `Any` which returns the raw type `java.lang.Class`. An alternative
253
- * way to get better `getClass` typing would be to treat `getClass` as a method of a generic
254
- * decorator which gets remapped in a later phase to Object#getClass. Then we could give it
255
- * the right type without changing the typechecker:
256
- *
257
- * implicit class AnyGetClass[T](val x: T) extends AnyVal {
258
- * def getClass: java.lang.Class[T] = ???
259
- * }
260
249
*/
261
250
@tu lazy val AnyClass: ClassSymbol = completeClass(enterCompleteClassSymbol(ScalaPackageClass, tpnme.Any, Abstract, Nil), ensureCtor = false)
262
251
def AnyType: TypeRef = AnyClass.typeRef
@@ -275,7 +264,7 @@ class Definitions {
275
264
@tu lazy val Any_typeCast: TermSymbol = enterT1ParameterlessMethod(AnyClass, nme.asInstanceOfPM, _.paramRefs(0), Final | Synthetic | Artifact | StableRealizable)
276
265
// generated by pattern matcher, eliminated by erasure
277
266
278
- // def getClass[A >: this.type](): Class[? <: A]
267
+ /** def getClass[A >: this.type](): Class[? <: A] */
279
268
@tu lazy val Any_getClass: TermSymbol =
280
269
enterPolyMethod(
281
270
AnyClass, nme.getClass_, 1,
0 commit comments