Improved type safety for memory writes
This commit is contained in:
parent
43a006e4af
commit
6483573923
7 changed files with 54 additions and 51 deletions
|
@ -2,6 +2,6 @@ main() {
|
|||
writeToMemory(42)
|
||||
}
|
||||
|
||||
writeToMemory(p *any) {
|
||||
p[0] = 'A'
|
||||
writeToMemory(p *byte) {
|
||||
[p] = 'A'
|
||||
}
|
6
tests/errors/TypeMismatch6.q
Normal file
6
tests/errors/TypeMismatch6.q
Normal file
|
@ -0,0 +1,6 @@
|
|||
import mem
|
||||
|
||||
main() {
|
||||
a := mem.alloc(1)
|
||||
a[0] = int64(1)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue