mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
avoid creating temporary in genObjConstr if possible (#7032)
This commit is contained in:
@@ -15,7 +15,8 @@ discard """
|
||||
(y: 678, x: 123)
|
||||
(y: 678, x: 123)
|
||||
(y: 0, x: 123)
|
||||
(y: 678, x: 123)'''
|
||||
(y: 678, x: 123)
|
||||
(y: 123, x: 678)'''
|
||||
"""
|
||||
|
||||
type
|
||||
@@ -75,3 +76,7 @@ when true:
|
||||
echo b # (y: 0, x: 123)
|
||||
b=B(y: 678, x: 123)
|
||||
echo b # (y: 678, x: 123)
|
||||
b=B(y: b.x, x: b.y)
|
||||
echo b # (y: 123, x: 678)
|
||||
|
||||
GC_fullCollect()
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
discard """
|
||||
output: '''42
|
||||
Foo'''
|
||||
"""
|
||||
|
||||
type TFoo{.exportc.} = object
|
||||
x:int
|
||||
|
||||
@@ -48,3 +53,5 @@ type NamedGraphic = object of Graphic2
|
||||
|
||||
var ngr = NamedGraphic(kind: Koo, radius: 6.9, name: "Foo")
|
||||
echo ngr.name
|
||||
|
||||
GC_fullCollect()
|
||||
|
||||
Reference in New Issue
Block a user