mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-20 11:30:43 +00:00
* fixes #21708; skip colon for tuples in VM * skip nimnodes * fixes types
This commit is contained in:
@@ -20,7 +20,7 @@ import
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/formatfloat
|
||||
|
||||
import astalgo
|
||||
import ast except getstr
|
||||
from semfold import leValueConv, ordinalValToString
|
||||
from evaltempl import evalTemplate
|
||||
@@ -844,6 +844,12 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of nkObjConstr:
|
||||
let n = src[rc + 1].skipColon
|
||||
regs[ra].node = n
|
||||
of nkTupleConstr:
|
||||
let n = if src.typ != nil and tfTriggersCompileTime in src.typ.flags:
|
||||
src[rc]
|
||||
else:
|
||||
src[rc].skipColon
|
||||
regs[ra].node = n
|
||||
else:
|
||||
let n = src[rc]
|
||||
regs[ra].node = n
|
||||
|
||||
@@ -688,3 +688,13 @@ block: # bug #7590
|
||||
# const c=(foo:(bar1: 0.0))
|
||||
const c=(foo:(bar1:"foo1"))
|
||||
fun2(c)
|
||||
|
||||
block: # bug #21708
|
||||
type
|
||||
Tup = tuple[name: string]
|
||||
|
||||
const X: array[2, Tup] = [(name: "foo",), (name: "bar",)]
|
||||
|
||||
static:
|
||||
let s = X[0]
|
||||
doAssert s[0] == "foo"
|
||||
|
||||
Reference in New Issue
Block a user