Files
Nim/tests/types
ringabout fd9d2f5b82 templates/macros use no expected types when return types are specified (#24298)
fixes #24296
fixes #24295

Templates use `expectedType` for type inference. It's justified that
when templates don't have an actual return type, i.e., `untyped` etc.

When the return type of templates is specified, we should not infer the
type

```nim
template g(): string = ""

let c: cstring = g()
```
In this example, it is not reasonable to annotate the templates
expression with the `cstring` type before the `fitNode` check with its
specified return type.

(cherry picked from commit 80e6b35721)
2024-10-23 08:12:50 +02:00
..
2018-09-24 16:00:57 +02:00
2017-06-20 11:29:42 +02:00
2020-03-22 20:01:01 +01:00
2020-03-22 19:35:55 +01:00