parent
a7bb973a24
commit
6f53579a8c
1 changed files with 21 additions and 0 deletions
21
tests/template/t9534.nim
Normal file
21
tests/template/t9534.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
discard """
|
||||||
|
targets: "c cpp"
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #9534
|
||||||
|
type
|
||||||
|
Object = object
|
||||||
|
data: int
|
||||||
|
|
||||||
|
template test() =
|
||||||
|
proc methodName(o: Object): int =
|
||||||
|
var p: pointer
|
||||||
|
doAssert o.data == 521
|
||||||
|
let f {.used.} = cast[proc (o: int): int {.nimcall.}](p)
|
||||||
|
doAssert o.data == 521
|
||||||
|
result = 1314
|
||||||
|
|
||||||
|
var a = Object(data: 521)
|
||||||
|
doAssert methodName(a) == 1314
|
||||||
|
|
||||||
|
test()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue