public class TraitTypeCheckingExtension
extends AbstractTypeCheckingExtension
An extension that handles field, super and static method calls within a trait.
| Fields inherited from class | Fields |
|---|---|
class AbstractTypeCheckingExtension |
context, debug, handled |
class TypeCheckingExtension |
typeCheckingVisitor |
| Constructor and description |
|---|
TraitTypeCheckingExtension(StaticTypeCheckingVisitor typeCheckingVisitor)Creates the trait-specific type-checking extension. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
afterMethodCall(MethodCall call)Checks a call to a private or static trait method from a closure against the delegate of the enclosing closure, if the delegate would be selected for a method of a class or the resolve strategy excludes the owner. |
|
public List<MethodNode> |
handleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)Resolves trait super calls and helper-backed trait method dispatch. |
|
public boolean |
handleUnresolvedProperty(PropertyExpression pexp)Resolves synthetic trait field accessor properties. |
|
public void |
onMethodSelection(Expression expression, MethodNode target)Keeps a call that the trait transformation marked for dynamic dispatch dynamic when the receiver type declares a method that matches it, and likewise keeps a @Virtual static accessor read as a property dynamic when the receiver
class has a getter of the same name, such as Class.getName(). |
Creates the trait-specific type-checking extension.
Checks a call to a private or static trait method from a closure against the delegate of the enclosing closure, if the delegate would be selected for a method of a class or the resolve strategy excludes the owner. Statically compiled code keeps the call to the trait helper otherwise. Dynamically compiled code selects the delegate or the trait helper at runtime.
Resolves trait super calls and helper-backed trait method dispatch.
Resolves synthetic trait field accessor properties.
Keeps a call that the trait transformation marked for dynamic dispatch dynamic
when the receiver type declares a method that matches it, and likewise keeps a
@Virtual static accessor read as a property dynamic when the receiver
class has a getter of the same name, such as Class.getName().
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.