summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-03-21 22:22:07 +0800
committerGitHub <noreply@github.com>2023-03-21 15:22:07 +0100
commitc814c4d993675551ecf388b6a583c471a1b8bc5e (patch)
tree0add411394b804e4de42fd19ce40ddaed4bb5d20 /compiler/semobjconstr.nim
parentf7e3af0c2d68035a649cf9449cc4e02a7ea59e84 (diff)
downloadNim-c814c4d993675551ecf388b6a583c471a1b8bc5e.tar.gz
fixes #3770; templates with untyped parameters resolve private fields wrongly in generics (#21554)
* fixes #3770; templates with untyped parameters resolve private fields wrongly

* add a test case for #3770

* rename to `nfSkipFieldChecking`
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r--compiler/semobjconstr.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index 29067cfa4..2d95da50d 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -76,7 +76,7 @@ proc semConstrField(c: PContext, flags: TExprFlags,
   let assignment = locateFieldInInitExpr(c, field, initExpr)
   if assignment != nil:
     if nfSem in assignment.flags: return assignment[1]
-    if nfUseDefaultField in assignment[1].flags:
+    if nfSkipFieldChecking in assignment[1].flags:
       discard
     elif not fieldVisible(c, field):
       localError(c.config, initExpr.info,
@@ -178,7 +178,7 @@ proc collectOrAddMissingCaseFields(c: PContext, branchNode: PNode,
           newSymNode(getSysMagic(c.graph, constrCtx.initExpr.info, "zeroDefault", mZeroDefault)),
           newNodeIT(nkType, constrCtx.initExpr.info, asgnType)
         )
-    asgnExpr.flags.incl nfUseDefaultField
+    asgnExpr.flags.incl nfSkipFieldChecking
     asgnExpr.typ = recTyp
     defaults.add newTree(nkExprColonExpr, newSymNode(sym), asgnExpr)