Class TraitTypeCheckingExtension

  • public class TraitTypeCheckingExtension
    extends AbstractTypeCheckingExtension
    A type checking extension that will take care of handling errors which are specific to traits. In particular, it will handle the "super" method calls within a trait.
    • Constructor Detail

      • TraitTypeCheckingExtension

        public TraitTypeCheckingExtension​(StaticTypeCheckingVisitor typeCheckingVisitor)
        Builds a type checking extension relying on a Groovy script (type checking DSL).
        typeCheckingVisitor - the type checking visitor
    • Method Detail

      • setup

        public void setup()
        Description copied from class: TypeCheckingExtension
        Subclasses should implement this method whenever they need to perform special checks before the type checker starts working.
        setup in class TypeCheckingExtension
      • handleMissingMethod

        public List<MethodNode> handleMissingMethod​(ClassNode receiver,
                                                    String name,
                                                    ArgumentListExpression argumentList,
                                                    ClassNode[] argumentTypes,
                                                    MethodCall call)
        Description copied from class: TypeCheckingExtension
        This method is called by the type checker when a method call cannot be resolved. Extensions may override this method to handle missing methods and prevent the type checker from throwing an error.
        handleMissingMethod in class TypeCheckingExtension
        receiver - the type of the receiver
        name - the name of the called method
        argumentList - the list of arguments of the call
        argumentTypes - the types of the arguments of the call
        call - the method call itself, if needed
        an empty list if the extension cannot resolve the method, or a list of potential methods if the extension finds candidates. This method must not return null.