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, and elegance (in that order of priority).
type
All = enum
a1
a2
b1
b2
A = range[a1..a2]
B = range[b1..b2]
proc test(a: A) =
echo a
test(b1)
As far as I can tell it correctly fails with the error "Error: conversion from All to A is invalid" when compiling with nim c, while running nim check on the file results in no error at all.
Nim Version
Nim Compiler Version 1.7.1 [Windows: amd64]
Compiled at 2022-07-29
Copyright (c) 2006-2022 by Andreas Rumpf
git hash: 528b6d1c3f001944a7a7754c8884178e365e6871
active boot switches: -d:release
Current Standard Output Logs
Hint: used config file 'C:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'C:\Nim\config\config.nims' [Conf]
..................................................................
C:\...\test123.nim(10, 3) Hint: 'B' is declared but not used [XDeclaredButNotUsed]
Hint:
28939 lines; 0.377s; 25.602MiB peakmem; proj: C:\...\test123.nim; out: unknownOutput [SuccessX]
Expected Standard Output Logs
$ nim c ./test123.nim
Hint: used config file 'C:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'C:\Nim\config\config.nims' [Conf]
..................................................................
C:\...\test123.nim(15, 6) Error: conversion from All to A is invalid
What happened?
Originally described in https://github.com/pragmagic/vscode-nim/issues/198
As far as I can tell it correctly fails with the error "Error: conversion from All to A is invalid" when compiling with
nim c
, while runningnim check
on the file results in no error at all.Nim Version
Nim Compiler Version 1.7.1 [Windows: amd64] Compiled at 2022-07-29 Copyright (c) 2006-2022 by Andreas Rumpf
git hash: 528b6d1c3f001944a7a7754c8884178e365e6871 active boot switches: -d:release
Current Standard Output Logs
Expected Standard Output Logs
Possible Solution
No response
Additional Information
No response