Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9801

Stub generator omits default interface methods

    XMLWordPrintableJSON

Details

    Description

      When presented with a Groovy interface that has a default method (shiny and new!) the stub generator omits the "default" part, leading to compilation failures in Java classes due to unimplemented abstract methods.

      interface HasDefaultMethod {
        default void method() { }
      }
      
      import java.lang.*;
      import java.util.*;
      import java.io.*;
      import java.net.*;
      import groovy.lang.*;
      import groovy.util.*;
      
      @groovy.transform.Trait() public interface HasDefaultMethod
        {
      ;
        void method();
      }
      

      (The stray semicolon is also odd but doesn't appear to be pathological.)

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              chrylis Christopher Smith
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h