ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

too much detail in error message on generic constraint #1464

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

This is an opinion, but given that someone struggling with type parameter constraints is probably already bleary eyed (that's me), I think this error message is overly verbose:

Refined member type parameter T of f in IA with upper bound which refining member type parameter T does not satisfy not yet supported: Null (T should be upper bounded by Null)

It does make perfect sense if you read every word from the start, but the fact that it would be nice to allow subclasses to refine methods in a less restrictive way is not relevant to correcting the error.

And if I'm going to complain... I guess I'll go all in :). The ever-present associated backend error marker doesn't help:

Sandbox.ceylon.snap.mod1.CA is not abstract and does not override abstract method <T>f(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor) in sandbox.ceylon.snap.mod1.IA

The errant code:

interface IA {
    shared default void f<T>() given T satisfies Null {}
}

class CA() satisfies IA {
    shared actual void f<T>() {}
}
gavinking commented 8 years ago

The ever-present associated backend error marker doesn't help:

Complain to ceylon-compiler then :-)

gavinking commented 8 years ago

@jvasileff is that better?

jvasileff commented 8 years ago

Yes, I think that will be much better. Thanks