forbid casting to bare unchecked array (#11186)

* fixes #11180, forbid casting to unchecked array.
* allow UncheckedArray as param
This commit is contained in:
Arne Döring 2019-05-08 09:36:27 +02:00 • committed by Andreas Rumpf
commit 34405db80f
3 changed files with 23 additions and 7 deletions

View file

@ -0,0 +1,9 @@
discard """
errormsg: '''
invalid type: 'UncheckedArray[uint8]' for var
'''
"""
var
rawMem = alloc0(20)
byteUA = cast[UncheckedArray[uint8]](rawMem)