mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
As shown in pragmagic/karax#67 using `this` as parameter name made the codegen output wrong code (and the user didn't notice the errors in the browser console).
24 lines
297 B
Nim
24 lines
297 B
Nim
proc moo1(this: int) =
|
|
doAssert this == 42
|
|
|
|
proc moo2(x: int) =
|
|
var this = x
|
|
doAssert this == 42
|
|
|
|
proc moo3() =
|
|
for this in [1,1,1]:
|
|
doAssert this == 1
|
|
|
|
proc moo4() =
|
|
type
|
|
X = object
|
|
this: int
|
|
|
|
var q = X(this: 42)
|
|
doAssert q.this == 42
|
|
|
|
moo1(42)
|
|
moo2(42)
|
|
moo3()
|
|
moo4()
|