groovy

Parent class print method is wrongly picked up

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-5
  • Fix Version/s: 1.0-JSR-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

When extending a java class that contains several overloaded 'print' methods, groovy seems to decide that none exists and uses the global print statement instead.

  1. Element.java
    06/Jan/04 5:38 AM
    0.2 kB
    Geert Bevin
  2. PrintTest.groovy
    06/Jan/04 5:38 AM
    0.2 kB
    Geert Bevin

Issue Links

Activity

Hide
Geert Bevin added a comment -

Btw, this only seems to happen with the << syntax that also uses inline ${} vars.

Show
Geert Bevin added a comment - Btw, this only seems to happen with the << syntax that also uses inline ${} vars.
Hide
Sam Pullara added a comment -

Its probably because its a GString, not a String. Make sure that you are overloading with GString.

Show
Sam Pullara added a comment - Its probably because its a GString, not a String. Make sure that you are overloading with GString.
Hide
Geert Bevin added a comment -

Even if it's not a GString, it shouldn't happen. This code is just an example, but in practise the extended class is part of another library that should not be made explicitely aware of Groovy.

Show
Geert Bevin added a comment - Even if it's not a GString, it shouldn't happen. This code is just an example, but in practise the extended class is part of another library that should not be made explicitely aware of Groovy.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: