nim-lang / Nim

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).
https://nim-lang.org
Other
16.46k stars 1.47k forks source link

Size pragma doesn't allow >8 bytes types #7674

Open mratsim opened 6 years ago

mratsim commented 6 years ago
type
  int128*{.importc: "__int128", size: 16.} = object

Error: power of two expected

The error seems to come from: https://github.com/nim-lang/Nim/blob/33b69f0ed0272a4792322d9a0fbaffd5bef2f6e9/compiler/pragmas.nim#L746

Araq commented 6 years ago

.size was only designed for enums, we need to see if it works for other imported types.