Comments (4)
I believe you meant set[int8]
rather than seq[int8]
? If so, could you update the title and body?
As as an aside, you can also use 1'i8
instead of 1.int8
(it's a bit shorter).
from nimskull.
sure seq
-> set
, sorry for confusion
from nimskull.
The examples in the body are still wrong, as in those should definitely be type errors; since you're attempting to assign a set to a sequence. The work around is confusing, is there a converter at play there because it would not work?
from nimskull.
this is more related to integer literals inference which most time inference to int
and don't respect other int
/uint
types.
other error examples:
const
my_array: array[4, int8] = [1, 1, 1, 1]
my_tuple: tuple[x, y: int8] = (1, 1)
var
x: int32
y: int32
x = 1 shl x
y = 1 shr y
Error: type mismatch: got 'array[0..3, int]' for '[1, 1, 1, 1]' but expected 'array[0..3, int8]'
Error: type mismatch: got '(int, int)' for '(1, 1)' but expected 'tuple[x: int8, y: int8]'
Error: type mismatch: got 'int' for '1 shl x' but expected 'int32'
Error: type mismatch: got 'int' for '1 shr y' but expected 'int32'
from nimskull.
Related Issues (20)
- calls introduced by macros does not exhibit automatic typedesc conversion HOT 1
- Generic parameters `void` and `not void` clash HOT 3
- stdlib_*.nim.c files generated incompatible with my platform HOT 2
- unconditional pointer member access is generated in C for inheritance HOT 2
- NULL dereference when an empty seq is passed to openArray HOT 1
- stdlib: organize the standard library modules (`lib`) HOT 4
- objChecks:off not respected in pragma form HOT 2
- confusion of forvar type when supplied as typed macro argument HOT 2
- attempt to define call operator can crash the compiler HOT 1
- getType doesn't reveal complete generic arguments HOT 1
- CI failures due to inconsistent binaries buildt on M1 runners HOT 1
- Emscripten compilation runs into undeclared `Tm` when importing `std/times` HOT 12
- incorrect control-flow when indirect call raises with `--panics:on` HOT 5
- UFCS issue iterator into macro HOT 4
- linking error when using `{.compile.}` pragma on .c files with same name but located on different paths HOT 1
- dot function call syntax inside a template can't lookup symbols of an imported module when the template is called from another module HOT 1
- ` .threadvar`s aren't destroyed on thread exit HOT 1
- value is implicitly moved even though it's used afterwards HOT 2
- procedure result is not cleaned up if the procedure raises HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nimskull.