diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vm/tvmmisc.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim index 005f7e255..c1e563806 100644 --- a/tests/vm/tvmmisc.nim +++ b/tests/vm/tvmmisc.nim @@ -306,6 +306,23 @@ block: # bug #8007 const d = @[Cost(kind: Fixed, cost: 999), Cost(kind: Dynamic, handler: foo)] doAssert $d == "@[(kind: Fixed, cost: 999), (kind: Dynamic, handler: ...)]" +block: # bug #14340 + block: + proc opl3EnvelopeCalcSin0() = discard + type EnvelopeSinfunc = proc() + # const EnvelopeCalcSin0 = opl3EnvelopeCalcSin0 # ok + const EnvelopeCalcSin0: EnvelopeSinfunc = opl3EnvelopeCalcSin0 # was bug + const envelopeSin = [EnvelopeCalcSin0] + var a = 0 + envelopeSin[a]() + + block: + type Mutator = proc() {.noSideEffect, gcsafe, locks: 0.} + proc mutator0() = discard + const mTable = [Mutator(mutator0)] + var i=0 + mTable[i]() + block: # VM wrong register free causes errors in unrelated code block: # bug #15597 #[ |