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...
``` nim type ZeroGenerator = object proc next(g: ZeroGenerator): int = 0 # This compiles. type TripleOfInts = tuple a, b, c: type(new(ZeroGenerator)[].next) # This raises a compiler error before...
### Description ```nim type SomeHandler = proc {.raises: [].} ``` ### Nim Version b880cdff49576c0eb83a043cbae595d3587c95b4 Works on 1.6.12 ### Current Output ```text /tmp/test.nim(1, 33) Error: invalid pragma: raises: [] ``` ###...
### Description Repro: - Create a `test.nim` file with e.g. `echo "hello"` in. - Compile with `nim c -r --hotcodereloading:on test.nim` - The build fails with clang errors. ### Nim...
### Description ```nim # Module main proc doThing*() import sub proc doThing*() = echo "hmm" # module sub.nim import main doThing() ``` ### Nim Version 2.0.8 and devel ### Current...
### Description For-loop transformation places for-loop variables before the transformed code, unnecessarily extending their scope, and then closure iters transformation lifts such variables because they appear in more than one...
This is very adhoc solution, but it does enable querying an approximation of the AST on generic instance/types.
### Description The `callOperator` fails to bind when the usage and declaration are spread across two different files. For example: ```nim ## ## myLib.nim ## type Functor* = ref object...
**Code** ```nim template foo(f) = f discard {foo: ord(true)} ``` **Result** ```nim Error: internal error: getTypeDescAux(tyUntyped) No stack traceback available ``` Without discard I get `Error: expression '[(foo, 1)]' is...
typeof(a[0]) in proc return type gives: Error: type mismatch ### Example ```nim # proc fn[T](a: T, index: int): typeof(a.x) = a.x # ok proc fn2(a: seq[int], index: int): typeof(a[0]) =...
Another case of difficulties working with types #7719/https://github.com/nim-lang/RFCs/issues/44 and subtypes #6454 in macros. In the following case I am trying to extract a subtype of multiple containers. It works fine...