Skip to content

Java objects inherit methods from Any #5313

Closed
@allanrenucci

Description

@allanrenucci

With Dotty:

scala> System.getClass                                                                                                                                                                                          
java.lang.NoClassDefFoundError: java/lang/System$
	at rs$line$1$.<init>(rs$line$1:1)
	...

with Scala 2:

scala> System.getClass
<console>:12: error: value getClass is not a member of object System
Note that System extends Any, not AnyRef.
Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
       System.getClass

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions