forbid casting to bare unchecked array (#11186)
* fixes #11180, forbid casting to unchecked array. * allow UncheckedArray as param
This commit is contained in:
parent
a5fb0acf5f
commit
34405db80f
3 changed files with 23 additions and 7 deletions
9
tests/errmsgs/tuncheckedarrayvar.nim
Normal file
9
tests/errmsgs/tuncheckedarrayvar.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
errormsg: '''
|
||||
invalid type: 'UncheckedArray[uint8]' for var
|
||||
'''
|
||||
"""
|
||||
|
||||
var
|
||||
rawMem = alloc0(20)
|
||||
byteUA = cast[UncheckedArray[uint8]](rawMem)
|
||||
Loading…
Add table
Add a link
Reference in a new issue