mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 15:25:22 +00:00
@@ -499,7 +499,7 @@ type
|
||||
nfFirstWrite# this node is a first write
|
||||
|
||||
TNodeFlags* = set[TNodeFlag]
|
||||
TTypeFlag* = enum # keep below 32 for efficiency reasons (now: ~40)
|
||||
TTypeFlag* = enum # keep below 32 for efficiency reasons (now: 43)
|
||||
tfVarargs, # procedure has C styled varargs
|
||||
# tyArray type represeting a varargs list
|
||||
tfNoSideEffect, # procedure type does not allow side effects
|
||||
@@ -566,6 +566,7 @@ type
|
||||
# (for importc types); type is fully specified, allowing to compute
|
||||
# sizeof, alignof, offsetof at CT
|
||||
tfExplicitCallConv
|
||||
tfIsConstructor
|
||||
|
||||
TTypeFlags* = set[TTypeFlag]
|
||||
|
||||
|
||||
@@ -2412,6 +2412,7 @@ proc semWhen(c: PContext, n: PNode, semCheck = true): PNode =
|
||||
proc semSetConstr(c: PContext, n: PNode): PNode =
|
||||
result = newNodeI(nkCurly, n.info)
|
||||
result.typ = newTypeS(tySet, c)
|
||||
result.typ.flags.incl tfIsConstructor
|
||||
if n.len == 0:
|
||||
rawAddSon(result.typ, newTypeS(tyEmpty, c))
|
||||
else:
|
||||
|
||||
@@ -1341,8 +1341,13 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
result = isSubtype
|
||||
else:
|
||||
result = typeRel(c, f[0], a[0], flags)
|
||||
if result <= isConvertible:
|
||||
result = isNone # BUGFIX!
|
||||
if result < isGeneric:
|
||||
if result <= isConvertible:
|
||||
result = isNone
|
||||
elif tfIsConstructor notin a.flags:
|
||||
# set constructors are a bit special...
|
||||
result = isNone
|
||||
|
||||
of tyPtr, tyRef:
|
||||
skipOwned(a)
|
||||
if a.kind == f.kind:
|
||||
|
||||
Reference in New Issue
Block a user