mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
@@ -13,21 +13,21 @@ proc add[T](x: var seq[T]; y: openArray[T])
|
||||
first type mismatch at position: 1
|
||||
required type for x: var seq[T]
|
||||
but expression 'k' is of type: Alias
|
||||
proc add[T](x: var seq[T]; y: T)
|
||||
first type mismatch at position: 1
|
||||
required type for x: var seq[T]
|
||||
but expression 'k' is of type: Alias
|
||||
proc add(result: var string; x: float)
|
||||
first type mismatch at position: 1
|
||||
required type for result: var string
|
||||
but expression 'k' is of type: Alias
|
||||
proc add(x: var string; y: string)
|
||||
first type mismatch at position: 1
|
||||
required type for x: var string
|
||||
but expression 'k' is of type: Alias
|
||||
proc add(x: var string; y: cstring)
|
||||
first type mismatch at position: 1
|
||||
required type for x: var string
|
||||
but expression 'k' is of type: Alias
|
||||
proc add[T](x: var seq[T]; y: T)
|
||||
proc add(x: var string; y: string)
|
||||
first type mismatch at position: 1
|
||||
required type for x: var seq[T]
|
||||
required type for x: var string
|
||||
but expression 'k' is of type: Alias
|
||||
proc add(result: var string; x: int64)
|
||||
first type mismatch at position: 1
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
discard """
|
||||
cmd: '''nim cpp --newruntime $file'''
|
||||
output: '''(field: "value")
|
||||
3 3 new: 0'''
|
||||
Indeed
|
||||
0 new: 0'''
|
||||
"""
|
||||
|
||||
import core / allocators
|
||||
@@ -13,10 +14,15 @@ type
|
||||
Node = ref object
|
||||
field: string
|
||||
|
||||
# bug #11807
|
||||
import os
|
||||
putEnv("HEAPTRASHING", "Indeed")
|
||||
|
||||
proc main =
|
||||
var w = newTable[string, owned Node]()
|
||||
w["key"] = Node(field: "value")
|
||||
echo w["key"][]
|
||||
echo getEnv("HEAPTRASHING")
|
||||
|
||||
main()
|
||||
|
||||
@@ -41,4 +47,4 @@ type
|
||||
var t: MyType
|
||||
|
||||
let (a, d) = allocCounters()
|
||||
discard cprintf("%ld %ld new: %ld\n", a, d, allocs)
|
||||
discard cprintf("%ld new: %ld\n", a - unpairedEnvAllocs() - d, allocs)
|
||||
Reference in New Issue
Block a user