Mono-D icon indicating copy to clipboard operation
Mono-D copied to clipboard

Support multiline compiler error messages

Open Trass3r opened this issue 11 years ago • 7 comments

It looks like the lines are treated independently and the second one is interpreted as a warning:

main.d(62): Error: struct main.Foo cannot deduce function from argument types !()(string), candidates are:
main.d(25):        main.Foo(Range)

Trass3r avatar May 12 '14 21:05 Trass3r

But err, there's more semantics in there, innit: On the first line, it's main.d:62, but then, it's on line 25. Hmm. I wouldn't even consider this as a complete bug due to this phenomenon then. Do you know about further 'semantics' in dmd's, gdc's or dub's error messages? Or may lead me to their code sources?

aBothe avatar May 12 '14 21:05 aBothe

Line 25 is the line of the candidate.

struct Foo(Range)
{
}

void foo()
{
    auto f = Foo(""); // maybe one day..
}

Trass3r avatar May 12 '14 21:05 Trass3r

Sure, so in which other way should it be presented to the user? Just as an exception? Or in some different behaviour?

aBothe avatar May 13 '14 06:05 aBothe

When writing this I thought it would just be pulled into the actual error message. But of course if the candidates are not right next to the code anymore this makes things worse. Maybe with links in the hover message? Not sure.

Trass3r avatar May 13 '14 07:05 Trass3r

Links or underlined stuff are probably not allowed. And those candidate hints aren't therefore actual errors but rather information messages, yeah, this might be useful. So it'll not be shown as warning but as info message (if XS allows that).

aBothe avatar May 13 '14 09:05 aBothe

Meh, there are only errors and warnings that may be added without hacking into the API too much. So I don't think that it's that unacceptable if these candidates become added to the warnings list -- They're also shown directly beneath the previously uttered error message, so all in all it should still be acceptable.

aBothe avatar May 13 '14 10:05 aBothe

Yeah sure it's no biggie. One could still file an enhancement request for the IDE to add an info category (VS does as well) for these kinds of things. Candidate lists, clang-like fixit messages, static analyzer results (which might also benefit from links between them.. xcode)

Trass3r avatar May 13 '14 15:05 Trass3r