mirror of https://github.com/m-labs/artiq.git
Shorten the unification error message when too redundant.
This commit is contained in:
parent
abbc87e981
commit
56d1a9bc57
|
@ -129,6 +129,13 @@ class Inferencer(algorithm.Transformer):
|
||||||
"expression of type {typeb}",
|
"expression of type {typeb}",
|
||||||
{"typeb": types.TypePrinter().name(typeb)},
|
{"typeb": types.TypePrinter().name(typeb)},
|
||||||
locb)
|
locb)
|
||||||
|
if e.typea.find() == typea.find() and e.typeb.find() == typeb.find():
|
||||||
|
diag = diagnostic.Diagnostic('fatal',
|
||||||
|
"cannot unify {typea} with {typeb}",
|
||||||
|
{"typea": types.TypePrinter().name(typea),
|
||||||
|
"typeb": types.TypePrinter().name(typeb)},
|
||||||
|
loca, [locb], notes=[note1, note2])
|
||||||
|
else: # give more detail
|
||||||
diag = diagnostic.Diagnostic('fatal',
|
diag = diagnostic.Diagnostic('fatal',
|
||||||
"cannot unify {typea} with {typeb}: {fraga} is incompatible with {fragb}",
|
"cannot unify {typea} with {typeb}: {fraga} is incompatible with {fragb}",
|
||||||
{"typea": types.TypePrinter().name(typea),
|
{"typea": types.TypePrinter().name(typea),
|
||||||
|
|
Loading…
Reference in New Issue