eclipse-archived / ceylon

The Ceylon compiler, language module, and command line tools
http://ceylon-lang.org
Apache License 2.0
398 stars 62 forks source link

squash nasty backend error for broken code #6186

Open gavinking opened 8 years ago

gavinking commented 8 years ago

Given this broken code:

interface Baz {}
interface Bar {}

interface Producer<out T> {
    shared formal void consume(T t);
}

interface ProducerBaz satisfies Producer<Baz> {}

interface ProducerBar satisfies Producer<Bar> {}

class Prod() satisfies Producer<Baz&Bar> & ProducerBaz & ProducerBar {
    shared actual void consume(Baz&Bar t) {}
}

I don't even notice the typechecker error, because my whole editor fills up with this backend error:

Ceylon backend error: method does not override or implement a method from a supertype

The error does have some location information (line 13) but for some reason it doesn't have what the IDE needs to localize the error.

gavinking commented 8 years ago

The error does have some location information (line 13) but for some reason it doesn't have what the IDE needs to localize the error.

@davidfestal is that a (new) bug in the IDE?

jvasileff commented 8 years ago

I don't even notice the typechecker error

I'm going to lobby again for backend errors to be suppressed in the IDE and CLI when typechecker errors exist, as a fix for cases like this and https://github.com/ceylon/ceylon/issues/6164.

I've never filed a bug report for a backend error caused by an attempt to compile invalid code, but I see this every day (ok, I shouldn't admit to writing that much bad code). Squashing most of these seems like a huge task, and all of them, impossible.

jvasileff commented 8 years ago

but I see this every day

For example:

screen shot 2016-04-08 at 6 11 36 pm
gavinking commented 8 years ago

@jvasileff Yeah, OK, so I've changed it to hide backend errors in any source file which doesn't pass the typechecker. I think that's a pretty big improvement.