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

Could not find matching constructor for inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.8-rc-2
    • None
    • class generator
    • None
    • Win7 x64, Groocy console 1.8-rc-2

    Description

      Runtime exception in function test()

      class c1 {
        c1() {   
          new c2('xxx')
          println 'c1 created'
        }
        
        static test() {
          new c2('xxx')
          println 'test'
        }
      
        class c2 {
          private s
          c2(String str) {
            s = str
            println 'c2 created'
          }
        }
      }
      
      new c1().test()
      

      Result:

      c2 created
      c1 created
      Exception thrown
      15.03.2011 15:07:44 org.codehaus.groovy.runtime.StackTraceUtils sanitize
      
      WARNING: Sanitizing stacktrace:
      
      groovy.lang.GroovyRuntimeException: Could not find matching constructor for: c1$c2(java.lang.String)
      ...
      	at c1.test(ConsoleScript7:8)
      ...
      

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            cs0ip Serge Grey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: