Files
Nim/tests/template/twrongmapit.nim
metagn b97d603cd0 some test cleanups & category reorganization (#22010)
* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
2023-06-06 06:54:07 +02:00

31 lines
553 B
Nim

discard """
joinable: false
"""
# bug #1562
type Foo* {.pure, final.} = object
elt: float
template defineOpAssign(T, op: untyped) =
proc `op`*(v: var T, w: T) {.inline.} =
for i in 0..1:
`op`(v.elt, w.elt)
const ATTEMPT = 0
when ATTEMPT == 0:
# FAILS: defining `/=` with template calling template
# ERROR about sem.nim line 144
template defineOpAssigns(T: untyped) =
mixin `/=`
defineOpAssign(T, `/=`)
defineOpAssigns(Foo)
# bug #1543
import sequtils
(var i = @[""];i).applyIt(it)
# now works:
doAssert i[0] == ""