Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "make default values typed in proc AST same as param sym AST" #24191

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,6 @@ 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")
Expand Down
4 changes: 2 additions & 2 deletions tests/errmsgs/tunknown_named_parameter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ func rsplit(s: string; sep: string; maxsplit: int = -1): seq[string]
first type mismatch at position: 2
required type for sep: string
but expression '{':'}' is of type: set[char]
func rsplit(s: string; seps: set[char] = {' ', '\t', '\v', '\r', '\n', '\f'};
maxsplit: int = -1): seq[string]
func rsplit(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): seq[
string]
first type mismatch at position: 3
unknown named parameter: maxsplits
Expand Down
50 changes: 0 additions & 50 deletions tests/proc/tdefaultvalueprocast.nim

This file was deleted.

Loading