Attributes
- Companion
- class
- Graph
-
- Supertypes
- Self type
-
InlineInfo.type
Members list
Type members
Inherited and Abstract types
The names of the product elements.
The name of the type.
Value members
Concrete methods
Check if a type is accessible to some class, as defined in JVMS 5.4.4. (A1) C is public (A2) C and D are members of the same run-time package
Check if a type is accessible to some class, as defined in JVMS 5.4.4. (A1) C is public (A2) C and D are members of the same run-time package
Attributes
Check if a member reference is accessible from the destinationClass, as defined in the JVMS 5.4.4. Note that the class name in a field / method reference is not necessarily the class in which the member is declared:
Check if a member reference is accessible from the destinationClass, as defined in the JVMS 5.4.4. Note that the class name in a field / method reference is not necessarily the class in which the member is declared:
class A { def f = 0 }; class B extends A { f }
The INVOKEVIRTUAL instruction uses a method reference "B.f ()I". Therefore this method has two parameters:
Value parameters
- memberDeclClass
-
The class in which the member is declared (A)
- memberRefClass
-
The class used in the member reference (B) (B0) JVMS 5.4.3.2 / 5.4.3.3: when resolving a member of class C in D, the class C is resolved first. According to 5.4.3.1, this requires C to be accessible in D. JVMS 5.4.4 summary: A field or method R is accessible to a class D (destinationClass) iff (B1) R is public (B2) R is protected, declared in C (memberDeclClass) and D is a subclass of C. If R is not static, R must contain a symbolic reference to a class T (memberRefClass), such that T is either a subclass of D, a superclass of D, or D itself. Also (P) needs to be satisfied. (B3) R is either protected or has default access and declared by a class in the same run-time package as D. If R is protected, also (P) needs to be satisfied. (B4) R is private and is declared in D. (P) When accessing a protected instance member, the target object on the stack (the receiver) has to be a subtype of D (destinationClass). This is enforced by classfile verification (https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.10.1.8). TODO: we cannot currently implement (P) because we don't have the necessary information available. Once we have a type propagation analysis implemented, we can extract the receiver type from there (https://github.com/scala-opt/scala/issues/13).