We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static range as a proc parameter:
proc foo(n: static[1..50]) = echo n foo(1) foo(0) foo(999)
1 0 999
Program fails to compile, giving a message such as Error: conversion from int literal(0) to static[range 1..50(int)] is invalid
Static range in a generic type:
type TileData[Size: static[5..99]] = object tiles: array[Size, uint8] var t: TileData[-3] echo t.tiles.len
-3
Program fails to compile. The compiler should complain that a TileData was declared with a Size outside the range of 5..99
TileData
Size
5..99
$ nim -v Nim Compiler Version 1.4.2 [Windows: amd64]
The text was updated successfully, but these errors were encountered:
array
fix arraymancer, enable static conversions
7679d4a
refs (fixes) nim-lang#7611, nim-lang#12559, nim-lang#16969, nim-lang#17423 but not nim-lang#23343
No branches or pull requests
Example 1
Static range as a proc parameter:
Current Output:
Expected Output:
Program fails to compile, giving a message such as
Error: conversion from int literal(0) to static[range 1..50(int)] is invalid
Example 2
Static range in a generic type:
Current Output:
Expected Output:
Program fails to compile. The compiler should complain that a
TileData
was declared with aSize
outside the range of5..99
Additional information
The text was updated successfully, but these errors were encountered: