<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57342>57342</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Parser fails assert on DenseElementsAttr with type tensor<vector<...>>
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rkayaith
      </td>
    </tr>
</table>

<pre>
    ```mlir
// test.mlir
#test = dense<22> : tensor<vector<4xi8>>
```
```console
$ mlir-opt test.mlir  
mlir-opt: <...>/llvm-project/mlir/lib/AsmParser/Token.cpp:82: std::string mlir::Token::getStringValue() const: Assertion `getKind() == string || getKind() == code_complete || (getKind() == at_identifier && getSpelling()[1] == '"')' failed.
```
Expected behaviour would be at least emitting an error message.

Some other cases:
```mlir
dense<[0, 1, 2, 3]> : tensor<2xvector<2xi8>> // error: inferred shape of elements literal ([4]) does not match type ([2])
dense<[0, 1]> : tensor<2xvector<2xi8>>       // fails same assert as above
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU01v3CAQ_TX4gmLZ-Pvgwza7ufRSKVWvETazNg02FuBN8u87YG_S5kOqhTAMj5k3M49Oi5eWlMk2JiUNSY4kORB2h4M6sC7-25p5CyXZkQqYLZDsljGSndByQPBstUHTBXoXFvmzrPHUj-3-NdC7ba_xpoJrkJz6kDd6cW8EKN1Oryc-IEaI49h7Z3dKXaabxejfGBu3gTNaZYfzwU4_uLHgLT_1I8xxvyzooGbei3UCfzisM3IeQuzNELDbcgB3H45_cbUCYTVhDfW0A5GDRedO6pliMgj9LmexY7BUvlq7b1Ld4qCfQnot4KHX06LAwRWJkE_B3D1I7ICTZwkGUSUO7_Z-AaUw0oYmxbeUFMfrJcIqgu3yc4MzPXOpQMSf9ub0vGAlQdAORn6RejX0Sa_K7zE4VcBRBzBJ53xefKZgjDZ0Amv5AFefYb7XE1DtRiTacwvWV_TfkG8Ku6oKmSeE3dLUT8xPGSbyQWns-VVr7FVrdBdvYOThcj7jGnOxI1-QypmCggmrZ6mSDgxXvs4YMvcxsMhCg6WzdnTirh-pe8FbG4JtiK_I_jfF7duJ-j5YajmWiQcl4Y_yTl_gXZ0iaNOyTLMibfIqEm0mmqzhkZNOQYssQh2x35vad7-7SxTn0fM97akfnMOWSren9_Hx7k8rO0WrUe3o3BI6FygPeG_tYlTr_vQ-vkBp7Yq9ZndFleUsGtuiYE3f1KJjgkOeJ1WSNyXLKpaeOxAiixTvQFmfB6p0hicaXHjFFsdItixhLKlZnuZZk1RxDlD0dVn2Z16nFU9InsCECceeR6zNEJk2UOrWweKhktbZt0OsihxmCGXz_vnqRm1a88hfOCYXhdht4P4HzmuGig">