Issue Details (XML | Word | Printable)

Key: GROOVY-2203
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Jochen Theodorou
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

missing cast in covariant return types implementation

Created: 13/Oct/07 04:34 PM   Updated: 13/Oct/07 04:35 PM
Component/s: None
Affects Version/s: 1.1-rc-1
Fix Version/s: 1.1-rc-2

Time Tracking:
Not Specified


 Description  « Hide
the following script does fail
class A<T> {
              T foo(T t) {1}
           }

          class B extends A<Long>{
              Long foo(Long l){2}
          }
          def b = new B();
          try {
            b.foo(new Object())
            assert false
          } catch (ClassCastException cce) {
            assert true
          }
          assert b.foo((Long) 1) == 2


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 13/Oct/07 04:35 PM
fixed