mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-22 14:50:57 +00:00
Merge remote-tracking branch 'origin/devel' into pr_unpack
This commit is contained in:
@@ -274,7 +274,7 @@ proc typeKey(c: var Context; t: PType; flags: set[ConsiderFlag]; conf: ConfigRef
|
||||
c.typeKey(t.sonsImpl[0], flags-{CoIgnoreRange}, conf)
|
||||
else:
|
||||
withTree c.m, toNifTag(t.kind):
|
||||
for i in 1..<t.sonsImpl.len:
|
||||
for i in 0..<t.sonsImpl.len:
|
||||
c.typeKey t.sonsImpl[i], flags, conf
|
||||
if tfNotNil in t.flagsImpl and CoType notin flags:
|
||||
c.m.addIdent "´notnil"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
discard """
|
||||
disabled: "linux"
|
||||
output: "42"
|
||||
output: '''
|
||||
42
|
||||
5
|
||||
'''
|
||||
"""
|
||||
|
||||
# Object variant / case object
|
||||
@@ -20,3 +22,14 @@ proc newInt(v: int): ref Node =
|
||||
|
||||
let n = newInt(42)
|
||||
echo n.intVal
|
||||
|
||||
# Sink and move semantics
|
||||
type
|
||||
BigObj = object
|
||||
data: seq[int]
|
||||
|
||||
proc consume(x: sink BigObj) =
|
||||
echo x.data.len
|
||||
|
||||
var b = BigObj(data: @[1, 2, 3, 4, 5])
|
||||
consume(move b)
|
||||
Reference in New Issue
Block a user