Files
Nim/tests/errmsgs
metagn 821d0806fe Revert "make default values typed in proc AST same as param sym AST" (#24191)
Reverts #24184, reopens #12942, reopens #19118

#24184 seems to have caused a regression in
https://github.com/c-blake/thes and
https://github.com/c-blake/bu/blob/main/rp.nim#L84 reproducible with
`git clone https://github.com/c-blake/cligen; git clone
https://github.com/c-blake/thes; cd thes; nim c -p=../cligen thes`.
Changing the `const` to `let` makes it compile.

A minimization that is probably the same issue is:

```nim
const a: seq[string] = @[]

proc foo(x = a) =
  echo typeof(x)
  echo x

import macros

macro resemFoo() =
  result = getImpl(bindSym"foo")

block:
  resemFoo() # Error: cannot infer the type of parameter 'x'
```

This should be a regression test in a future reimplementation of #24184.
2024-09-27 15:34:09 +02:00
..
2018-07-05 15:51:04 +02:00
2018-07-02 22:53:00 +02:00
2018-12-11 21:23:22 +01:00
2021-04-06 16:20:01 +02:00
2020-03-22 20:01:01 +01:00
2022-09-23 13:05:05 +02:00
2021-06-22 12:44:56 +02:00
2023-01-18 21:40:00 +01:00
2018-04-21 22:49:15 +02:00
2021-04-06 16:20:01 +02:00
2019-07-08 15:24:20 -07:00
2021-04-06 16:20:01 +02:00
2021-04-06 16:20:01 +02:00
2021-04-06 16:20:01 +02:00