Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.5.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Windows XP, java 6 update 4, ant 1.7, groovy 1.6 beta 1
-
Number of attachments :
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.
Issue Links
- is depended upon by
-
GROOVY-2503
MOP 2.0 design inflluencing issues
-
- is duplicated by
-
GROOVY-2049
Provide some auto-overloading between int and String values
-
-
GROOVY-3632
Cannot overload/override setter with mutliple methods
-
Sorry, by accident I did select the 'fix version' instead of the 'affects version'.