Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.1
-
None
-
Windows XP, java 6 update 4, ant 1.7, groovy 1.6 beta 1
Description
The following build.xml fails:
<?xml version="1.0" encoding="UTF-8"?> <project name="test" default="run"> <path id="groovy.classpath"> <fileset dir="." includes="groovy-*.jar"/> </path> <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="groovy.classpath"/> <target name="compile"> <echo file="Test.java"> public class Test { public void setField( String value ) { System.out.println( "String" ); } public void setField( Integer value ) { System.out.println( "Integer" ); } } </echo> <javac srcdir="." includes="Test.java"/> </target> <target name="run" depends="compile"> <groovy> try { new Test().setField( "sss" ) // This works println "success 1" new Test().field = "sss" // This gives exception println "success 2" } catch( Exception e ) { e.printStackTrace( System.out ) } </groovy> </target> </project>
(you need to put the groovy.jar in the same folder)
The setField() succeeds, but the assignment fails.
If I change the order of the two setField() methods, both succeed.
Attachments
Issue Links
- is depended upon by
-
GROOVY-2503 MOP 2.0 design inflluencing issues
- Open
- is duplicated by
-
GROOVY-2049 Provide some auto-overloading between int and String values
- Closed
-
GROOVY-3632 Cannot overload/override setter with mutliple methods
- Closed