forked from M-Labs/artiq
Better error reporting for List.
This commit is contained in:
parent
4b7d4c2425
commit
e18ea0daae
|
@ -268,9 +268,9 @@ class Inferencer(algorithm.Transformer):
|
||||||
def makenotes(printer, typea, typeb, loca, locb):
|
def makenotes(printer, typea, typeb, loca, locb):
|
||||||
return [
|
return [
|
||||||
diagnostic.Diagnostic("note",
|
diagnostic.Diagnostic("note",
|
||||||
"a list of type {typea}",
|
"a list element of type {typea}",
|
||||||
{"typea": printer.name(node.type)},
|
{"typea": printer.name(node.elts[0].type)},
|
||||||
loca),
|
node.elts[0].loc),
|
||||||
diagnostic.Diagnostic("note",
|
diagnostic.Diagnostic("note",
|
||||||
"a list element of type {typeb}",
|
"a list element of type {typeb}",
|
||||||
{"typeb": printer.name(typeb)},
|
{"typeb": printer.name(typeb)},
|
||||||
|
|
|
@ -9,7 +9,7 @@ a = b
|
||||||
|
|
||||||
# CHECK-L: ${LINE:+1}: error: cannot unify int(width='a) with list(elt='b)
|
# CHECK-L: ${LINE:+1}: error: cannot unify int(width='a) with list(elt='b)
|
||||||
[1, []]
|
[1, []]
|
||||||
# CHECK-L: note: a list of type list(elt=int(width='a))
|
# CHECK-L: note: a list element of type int(width='a)
|
||||||
# CHECK-L: note: a list element of type list(elt='b)
|
# CHECK-L: note: a list element of type list(elt='b)
|
||||||
|
|
||||||
# CHECK-L: ${LINE:+1}: error: cannot unify int(width='a) with bool
|
# CHECK-L: ${LINE:+1}: error: cannot unify int(width='a) with bool
|
||||||
|
|
Loading…
Reference in New Issue