Big compiler Cleanup (#14777)
This commit is contained in:
parent
f8c48fc186
commit
13e659cfec
53 changed files with 481 additions and 783 deletions
|
|
@ -786,7 +786,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
|||
{sfImportc, sfExportc} * fieldOwner.flags != {} and
|
||||
not hasCaseFields and f.loc.r == nil:
|
||||
f.loc.r = rope(f.name.s)
|
||||
f.flags = f.flags + ({sfImportc, sfExportc} * fieldOwner.flags)
|
||||
f.flags.incl {sfImportc, sfExportc} * fieldOwner.flags
|
||||
inc(pos)
|
||||
if containsOrIncl(check, f.name.id):
|
||||
localError(c.config, info, "attempt to redefine: '" & f.name.s & "'")
|
||||
|
|
@ -1211,11 +1211,9 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
|
|||
|
||||
if hasType:
|
||||
typ = semParamType(c, a[^2], constraint)
|
||||
let sym = getCurrOwner(c)
|
||||
var owner = sym.owner
|
||||
# TODO: Disallow typed/untyped in procs in the compiler/stdlib
|
||||
if kind == skProc and (typ.kind == tyTyped or typ.kind == tyUntyped):
|
||||
if not isMagic(sym):
|
||||
if not isMagic(getCurrOwner(c)):
|
||||
localError(c.config, a[^2].info, "'" & typ.sym.name.s & "' is only allowed in templates and macros or magic procs")
|
||||
|
||||
if hasDefault:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue