ceylon / ceylon-compiler

DEPRECATED
GNU General Public License v2.0
138 stars 36 forks source link

Failure to use produced type in default parameter method of member class of interface #1936

Closed tombentley closed 9 years ago

tombentley commented 9 years ago

The compiler break with this

interface I<T> {
    shared class Member(T? t = null) {

    }
}
class C() satisfies I<String> {}
tombentley commented 9 years ago

Is seems that nonWideningTypeDecl() is returning T instead of String in this case, because isWideningTypeArguments() is returning true. I think that must be wrong, because this is just the case of type constructor application. But only @FroMage really understands this code.

FroMage commented 9 years ago

But only @FroMage really understands this code.

First, you're assuming I have god-like powers. It's both flattering and alarming in what it says about your perception skills ;)

As I've noted in the past, this widening/erasure thing is genetic programming, so you know what to do.

tombentley commented 9 years ago

Well I put in a check which seems logical, and made my test pass, but probably isn't the whole story.

FroMage commented 9 years ago

It never is the whole story. images

tombentley commented 9 years ago

Despite the fact I could swear all the tests passed prior to pushing, that fix has caused regressions. Reopening.

FroMage commented 9 years ago

So is this fixed then, @tombentley ?

tombentley commented 9 years ago

Well there's a test there being executed and it's passing so I suppose it must be.

FroMage commented 9 years ago

Excellent! :)