Nim
Nim copied to clipboard
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, an...
fixes #15314, fixes #24002 The OpenSym behavior first added to generics in #23091 now also applies to templates, since templates can also capture symbols that are meant to be replaced...
updated version of #22193 After #22029 and the followups #23983 and #24005 which fixed issues with it, `tyFromExpr` no longer match any proc params in generic type bodies but delay...
`block label` matching template with untyped param treats param as typed, causing error ### Example 1 ```nim template fun*(a: untyped) = discard block fun: # BUG # block: # fun...
`$type(myarray.high)` shows `range 0..3(int)` instead of `int` ### Example ```nim when true: var a: array[0..3, float] const N = high(a) doAssert N is int echo $type(N) ``` ### Current Output...
This code errors at C compilation step ### Example ```nim proc myMegaProc(a: string, b: seq[string] | seq[bool] = @[]) = when a is string: discard elif b is seq[string]: for...
### Updated example (from the comment below) ```nim template returnType(value: static[int]): typedesc = when value == 1: int else: float proc fun*(value: static[int]): returnType(value) = discard echo fun(1) ``` ----...
### Example ```nim proc main = var x = 123 proc withClosure = echo x proc withoutClosure = discard let _ = if true: withClosure else: withoutClosure # fine let...
When X tries to use the following type Y as a generic, and Y isn't a generic, the compiler has an internal error. When Y is defined before X, the...
sigmatch error is unhelpful and incorrect with `[]` ### Example ```nim type Foo* = object type Idx = csize_t proc `[]`(s: var Foo, idx: Idx): int = discard var a:...
### Example ```nim # a.nim template aPragma*() = ... # b.nim import a proc b() {.aPragma.} = ... ``` I also tried" ```nim proc b() {.a.aPragma.} = ... ``` ###...