Sorry for not being able to create a minimal reproducible example for this, everything I've tried compiles fine.
I have a decently sized project (https://github.com/codic12/worm) which builds just fine with Nim 1.6.0. However if I am using Nim 1.4.8, there are strange compilation errors (https://github.com/codic12/worm/issues/21):
/home/wc/.cache/nim/worm_r/@mworm.nim.c: In function ‘getProperty__9aiI5srh3lf4yinTF7HA9aGQ’:
/home/wc/.cache/nim/worm_r/@mworm.nim.c:3022:26: error: incompatible types when assigning to type ‘tyObject_Option__hcmjwL9c5ECYpHnVevXHwEQ’ from type ‘tyObject_Option__9bcZreTqxpOXg5u4xcKsUEw’
3022 | result = colontmpD__2;
| ^~~~~~~~~~~~
/home/wc/.cache/nim/worm_r/@mworm.nim.c: In function ‘handleUnmapNotify__IBNx9c2pqwde9cI9bE9afvcRpw’:
/home/wc/.cache/nim/worm_r/@mworm.nim.c:4423:27: error: incompatible types when assigning to type ‘tyObject_Option__hcmjwL9c5ECYpHnVevXHwEQ’ from type ‘tyObject_Option__9bcZreTqxpOXg5u4xcKsUEw’
4423 | (*self).focused = T12_;
| ^~~~
/home/wc/.cache/nim/worm_r/@mworm.nim.c: In function ‘handleDestroyNotify__UtpRh9a9bdEb3vV3vfdWHAsw’:
/home/wc/.cache/nim/worm_r/@mworm.nim.c:4509:27: error: incompatible types when assigning to type ‘tyObject_Option__hcmjwL9c5ECYpHnVevXHwEQ’ from type ‘tyObject_Option__9bcZreTqxpOXg5u4xcKsUEw’
4509 | (*self).focused = T12_;
| ^~~~
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -O3 -fno-strict-aliasing -fno-ident -I/usr/lib/nim -I/home/wc/tmp/worm/src -o /home/wc/.cache/nim/worm_r/@mworm.nim.c.o /home/wc/.cache/nim/worm_r/@mworm.nim.c' failed with exit code: 1
Here's how one of those procs (handleUnmapNotify) looks:
proc handleUnmapNotify(self: var Wm; ev: XUnmapEvent): void =
let clientOpt = self.findClient do (client: Client) -> bool: client.window == ev.window
if clientOpt.isNone: return
let client = clientOpt.get[0]
discard self.dpy.XUnmapWindow client.frame.window
self.clients.del clientOpt.get[1]
self.updateClientList
discard self.dpy.XSetInputFocus(self.root, RevertToPointerRoot, CurrentTime)
self.focused = none uint # TODO: focus last window
if self.layout == lyTiling: self.tileWindows
For some reason, the none uint fails to compile. How can I fix/workaround this?
works as a workaround, i guess. thanks!
the reason I need it to compile on 1.4.8 is to package it for the AUR; choosenim on the AUR gets a bit messy.