[ nice-Bugs-1672222 ] Abstract interfaces and covariant return types

"SourceForge.net" <[email protected]> Thu, 01 Mar 2007 22:56:29 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #1672222, was opened at 2007-03-02 06:45
Message generated for change (Comment added) made by drmaciver
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1672222&group_id=12788

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: David R. MacIver (drmaciver)
Assigned to: Nobody/Anonymous (nobody)
Summary: Abstract interfaces and covariant return types

Initial Comment:
Code:

package test;
import nice.functional;

class Test implements Foo 
{
    Test[] children;
}

more(Test t) = generator(t.children);

abstract interface Foo 
{
}

<Foo T> () -> T more(T t); 

Compiler error:

Incorrect return type:
Found   : ()->test.Test
Expected: ()->T

This appears not to always fail. For example if I replace the implementation with 

more(Test t) = () => t;

The code compiles fine.

I've not been able to narrow down exactly what circumstances it fails in.

----------------------------------------------------------------------

>Comment By: David R. MacIver (drmaciver)
Date: 2007-03-02 06:56

Message:
Logged In: YES 
user_id=1681313
Originator: YES

As pointed out by arjanb in #nice, if you replace 'implements Foo' with
'finally implements Foo', this starts working. I still think it's a bug
though. :-)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1672222&group_id=12788

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV