mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
compilation cache: fixed recently introduced bug (lazy loading of bodies)
This commit is contained in:
13
tests/rodfiles/tgeneric1.nim
Normal file
13
tests/rodfiles/tgeneric1.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
output: "abcd"
|
||||
"""
|
||||
|
||||
import tables
|
||||
|
||||
var x = initTable[int, string]()
|
||||
|
||||
x[2] = "ab"
|
||||
x[5] = "cd"
|
||||
|
||||
echo x[2], x[5]
|
||||
|
||||
13
tests/rodfiles/tgeneric2.nim
Normal file
13
tests/rodfiles/tgeneric2.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
output: "abef"
|
||||
"""
|
||||
|
||||
import tables
|
||||
|
||||
var x = initTable[int, string]()
|
||||
|
||||
x[2] = "ab"
|
||||
x[5] = "ef"
|
||||
|
||||
echo x[2], x[5]
|
||||
|
||||
@@ -309,6 +309,10 @@ proc runRodFiles(r: var TResults, options: string) =
|
||||
test "bmethods2.nim"
|
||||
delNimCache()
|
||||
|
||||
# test generics:
|
||||
test "tgeneric1.nim"
|
||||
test "tgeneric2.nim"
|
||||
delNimCache()
|
||||
|
||||
proc compileRodFiles(r: var TResults, options: string) =
|
||||
template test(filename: expr): stmt =
|
||||
|
||||
Reference in New Issue
Block a user