summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-09-27 10:33:40 +0300
committerGitHub <noreply@github.com>2024-09-27 09:33:40 +0200
commitc21bf7f41babcdb049c54d4e148883606764947e (patch)
tree23dc16a4ffcf327d9c0e570dcbe31d812cadd4cd /compiler
parent62a5bb4d0acfea39797b8b5207786c1d61e12b1b (diff)
downloadNim-c21bf7f41babcdb049c54d4e148883606764947e.tar.gz
make default values typed in proc AST same as param sym AST (#24184)
fixes #12942, fixes #19118

This is the exact same as #20735 but maybe the situation has improved
after #24065.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 450b81dbf..6fe921e81 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1404,6 +1404,8 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
         elif typ.kind == tyStatic:
           def = semConstExpr(c, def)
           def = fitNode(c, typ, def, def.info)
+      # keep proc AST updated
+      a[^1] = def
 
     if not hasType and not hasDefault:
       if isType: localError(c.config, a.info, "':' expected")