Fwd: Groovy Bug?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Groovy Bug?

Guillaume Laforge
Administrator
Hi,

Someone sent me the following email, showing a problem, which triggers an interesting error message:
"This method should not have been called."

Coming from here:

Guillaume


---------- Forwarded message ----------
Date: Tue, May 2, 2017 at 10:37 AM
Subject: Groovy Bug?


Hello,

I am playing around with groovy and the map data type I then added the CompileStatic annotation and I got the following result. Since I have no deep knowledge of Groovy I can't judge what this means but since groovy mentions I should issue a bug. I have not done this via jira since I don't have an account there, but I think it is fair to inform you about this.
 

// Ececuted with C:/Tools/Groovy/bin/groovy.bat in the following environment

// Groovy Version: 2.4.10 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Windows 7

// Output

// Caught: BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

// BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

 

import groovy.transform.TypeChecked

import groovy.transform.CompileStatic

 

@TypeChecked

@CompileStatic

class Main {

 

    static void main(String... args)

    {

        def FileListName_m    = [:]

        def Map C_ASM_Files_m = [:]

        def CFiles_m          = [:]

 

        CFiles_m['foo.c'] = 'bar.c'

        FileListName_m['C_FILES']   = CFiles_m

 

        C_ASM_Files_m << (Map)FileListName_m.C_FILES

    }

}



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy Bug?

paulk_asert
Removing the @TypeChecked line will achieve what they want - should probably be raised as an error though.

On Tue, May 2, 2017 at 9:50 PM, Guillaume Laforge <[hidden email]> wrote:
Hi,

Someone sent me the following email, showing a problem, which triggers an interesting error message:
"This method should not have been called."

Coming from here:

Guillaume


---------- Forwarded message ----------
Date: Tue, May 2, 2017 at 10:37 AM
Subject: Groovy Bug?


Hello,

I am playing around with groovy and the map data type I then added the CompileStatic annotation and I got the following result. Since I have no deep knowledge of Groovy I can't judge what this means but since groovy mentions I should issue a bug. I have not done this via jira since I don't have an account there, but I think it is fair to inform you about this.
 

// Ececuted with C:/Tools/Groovy/bin/groovy.bat in the following environment

// Groovy Version: 2.4.10 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Windows 7

// Output

// Caught: BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

// BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

 

import groovy.transform.TypeChecked

import groovy.transform.CompileStatic

 

@TypeChecked

@CompileStatic

class Main {

 

    static void main(String... args)

    {

        def FileListName_m    = [:]

        def Map C_ASM_Files_m = [:]

        def CFiles_m          = [:]

 

        CFiles_m['foo.c'] = 'bar.c'

        FileListName_m['C_FILES']   = CFiles_m

 

        C_ASM_Files_m << (Map)FileListName_m.C_FILES

    }

}



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy Bug?

Guillaume Laforge
Administrator
Yeah, the thing is we shouldn't be showing that message: either we raise an error, or it's type checked properly.

On Tue, May 2, 2017 at 2:59 PM, Paul King <[hidden email]> wrote:
Removing the @TypeChecked line will achieve what they want - should probably be raised as an error though.

On Tue, May 2, 2017 at 9:50 PM, Guillaume Laforge <[hidden email]> wrote:
Hi,

Someone sent me the following email, showing a problem, which triggers an interesting error message:
"This method should not have been called."

Coming from here:

Guillaume


---------- Forwarded message ----------
Date: Tue, May 2, 2017 at 10:37 AM
Subject: Groovy Bug?


Hello,

I am playing around with groovy and the map data type I then added the CompileStatic annotation and I got the following result. Since I have no deep knowledge of Groovy I can't judge what this means but since groovy mentions I should issue a bug. I have not done this via jira since I don't have an account there, but I think it is fair to inform you about this.
 

// Ececuted with C:/Tools/Groovy/bin/groovy.bat in the following environment

// Groovy Version: 2.4.10 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Windows 7

// Output

// Caught: BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

// BUG! exception in phase 'class generation' in source unit 'B:\workspace\Groovy\NinjaGen\NinjaGenerator.groovy' At line 17 column 9

// On receiver: C_ASM_Files_m with message: leftShift and arguments: (java.util.Map -> java.util.Map <K extends java.lang.Object, V extends java.lang.Object>) FileListName_m.C_FILES

// This method should not have been called. Please try to create a simple example reproducing

// this error and file a bug report at https://issues.apache.org/jira/browse/GROOVY

 

import groovy.transform.TypeChecked

import groovy.transform.CompileStatic

 

@TypeChecked

@CompileStatic

class Main {

 

    static void main(String... args)

    {

        def FileListName_m    = [:]

        def Map C_ASM_Files_m = [:]

        def CFiles_m          = [:]

 

        CFiles_m['foo.c'] = 'bar.c'

        FileListName_m['C_FILES']   = CFiles_m

 

        C_ASM_Files_m << (Map)FileListName_m.C_FILES

    }

}



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform





--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Loading...