fixes #21027; cast expressions need a type (#21029)

* fixes #21027; cast expressions need a type

* Apply suggestions from code review

Thanks to @beef331
This commit is contained in:
ringabout 2022-12-06 20:09:50 +08:00 • committed by GitHub
commit 1564ae650f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

5
tests/types/t21027.nim Normal file
View file

@ -0,0 +1,5 @@
discard """
errormsg: "Invalid usage of cast, cast requires a type to convert to, e.g., cast[int](0d)."
"""
# bug #21027
let x: uint64 = cast(5)