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

New "def" has short term memory in shell

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.1-rc-3
    • None
    • None

    Description

      groovy> def foo

      { println(x) }

      groovy>
      null
      groovy> foo(5)
      groovy>
      Caught: groovy.lang.MissingMethodException: No such method: foo for class: CommandLine2 with arguments: [5]
      groovy.lang.MissingMethodException: No such method: foo for class: CommandLine2 with arguments: [5]
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:285)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:241)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:758)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:214)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:95)
      at CommandLine2.invokeMethod(CommandLine2.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:95)
      at CommandLine2.run(CommandLine2.groovy)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:236)
      at groovy.lang.GroovyShell.evaluate(GroovyShell.java:215)
      at groovy.ui.InteractiveShell.run(InteractiveShell.java:100)
      at groovy.ui.InteractiveShell.main(InteractiveShell.java:71)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Issue Links

          Activity

            People

              user57 Jason Dillon
              rodcope Rod Cope
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: