eclipse-archived/ceylon

Typechecker does not apply same type inference to type functions as generic functions

Closed this issue · 6 comments

The typechecker tests fail where we have the following sort of calls:

    value pl = plus;
    Integer sum1 = [1,2,3].fold(0, plus); // OK
    Integer sum2 = [1,2,3].fold(0, pl); // FAIL

Because the new type inference that allowed the fold refactoring to pass in the first case was probably not adapted for type functions such as pl?

That's blocking the typechecker tests.

@gavinking either this is supposed to work, and can you fix it, or it's not and I can disable those tests?

Looks like #7251 overlooked type functions.

OK, I will take a look.

I have pushed a really fragile fix to this problem, and now all the typechecker tests are passing, however, I would like to come back to this and try to clean up the fix.

Thanks. Will try it out ASAP.

Y'know, coming back to this, my fix is really not that fragile. In fact, I guess it's no more fragile than the situation with a direct function ref. So I'm going to close this.