<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57592>57592</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR Core] `Attribute` shouldn't be implicitly convertible to `TypedAttr`
</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>
I ran into a runtime crash today that should have been caught at compile time, this:
```
void foo(TypedAttr ta);
void bar(Attribute a) {
foo(a);
}
```
While we should support an /explicit/ cast from Attribute to TypedAttr, this shouldn't be implicit.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1UU1v2zAM_TXyhVigyN8HH9oGBQpsl2HAzpLMxCpky5DotPn3o92k6YANECQSfOR7jzKhv3QvEPUEbqIAGuIykRsRbNRpAAq9vgANmiANYfE9DPqMYBAnsHo5DQRcsmGcnUdYG4V6YrxLIn8Q8iDk7a7k9WzpObgejiEI1fy6zNg_EEUgLVQr8scvEKMjQ9aqMwshrAgQ9RUC1xF_9Yn68E_Kj_v3sAp9w5udtMxziOxiAqGe8X32zjrikO0lgmMMI9zpeUOfcm9Gr5MmoWrixYAbP2bsvtJm2O2rSpVSVnWT9V3et3mrM3LksRPl44_vLz_hKUQU5QFY8iclx_8j8Bde_HTGSM74TRuD7_IqmS3RdwPRvH2GeuZzcjQsZscfxon359vzbY7hFe1q3KW0YOKgrMtWZUOnytqWqrKFLJqisdaUdd-irFRj82Opbea1QZ9WG0Kp0bvIdHb1ohTbyVynpFKy5Y59UeTNTmlTmlYV-2J_RJM3opA4aud3q5JdiKcsdpsos5wSF71LlO5FnZI7TbjtbZ2vFxoCd2iiCWO26e828X8AcxTkYA">