<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59334>59334</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR Core] `AsmPrinter` can print value range but does something weird (minor foot gun)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir:core
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
lattner
</td>
</tr>
</table>
<pre>
Minor bug I noticed, but this compiled for a `custom<>` in an operation:
```
static void printMyCustomThing(AsmPrinter &p, Operation *op, ValueRange operands) {
// simplified...
p << '(' << operands << ')';
}
```
but it only printed the types for the operands, not the SSA value. The bug was that I should have passed in `OpAsmPrinter` instead of `AsmPrinter` baseclass, but this seems like a violation of the liskov substitution principle - it seems like the code above shouldn't compile, it shouldn't change behavior based on what level of type is specified.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU1FvqzoM_jXmxRqiSQv0gYeuvZUm3WlX23TfA3EhZ4EgHJj6748SWm3TOVKVKjZ2vu-zP8Vs2oGogt0j7E6Jmn3npsoq7weaktrpa_VsBjdhPbf4hIPzpiEN4oj17NF3hrFx_Wgsaby4CRVCnjUze9eDPIL8B_IMzYBqQDfSpLxxA8gDZCfI7mee3X7xyl550-DijMZxMoN_vh5jv_fODC2I8sD9fyFOE4LIx4Dl5d4aQRxcDP2v7EyvamhpfXjQDGKPUDyuzyCCOIM4I5t-tOZiSKdpes-NGNEfEUQBogRR3AP3Zj8-2IdT3jpDcforsfUMshmPbrDXlR5p9B2hv47EUcJw-4J8DJrH2NvbAZfAKkV87yhO5FMx-k55fELu3Gw1dmohHBUz6aA75NnL-KXYOg32pDS6S8j-zNWKqbGK-ceEmahntOaDUOFinF21dpeIyxr-cAvyXLM3fo6pwKwxoyV8CGy_NQgVjdOEqnYL3VAPIAp_X6TwdKj5nuniIGvq1GLCMqpAzw34GbhbWshGNNeRMOAdqVknumqe6ErqvdyrhKpNXmSbotiJMukqpWulayrKjcxKuWu2tcy3stgXGZHM5SYxlciE2Ihsuyk3IpOpznSpL3mz0xdBudawzahXxqbWLn3qpjYxzDNVu72U28SqmixHcwnRWzOBPDRuIhAiuG2qQtVDPbcM28wa9vzVxxtvoy-f_316xWOo2p3-nFijVrX9uhs4rUrNHrUjRnY9-WAc_CQzaQRR9tHPF-c8tvMAYp_Mk60670cOzoyuaI3v5jptXA_iHCDd_h7Gyf2ixoM4R54M4hyp_g4AAP__w19fgw">