Hi,
Consider the following code
# strange_option.nim
import options
let a: Option[int] = none(var int)
Run
When I compile with `nim c strange_option.nim` I get the following error
Hint: used config file '/usr/local/Cellar/nim/0.19.4/nim/config/nim.cfg'
[Conf]
Hint: system [Processing]
Hint: strange_option [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
CC: strange_option
Error: execution of an external compiler program 'clang -c -w
-I/usr/local/Cellar/nim/0.19.4/nim/lib -o
/Users/rory/.cache/nim/strange_option_d/strange_option.c.o
/Users/rory/.cache/nim/strange_option_d/strange_option.c' failed with exit
code: 1
/Users/rory/.cache/nim/strange_option_d/strange_option.c:127:29: error:
assigning to 'tyObject_Option_Ryv9bNNePiiahF9b3Btk2KGA' (aka 'struct
tyObject_Option_Ryv9bNNePiiahF9b3Btk2KGA') from incompatible type
'tyObject_Option_lceG9aukqGbMbPd5JxWfL2Q' (aka 'struct
tyObject_Option_lceG9aukqGbMbPd5JxWfL2Q')
a_9aGASzYrmK9cmn6qwbMxS3LQ = none_07zXLdOnVAgxb9ckd004ZrQ();
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run
My nim code is clearly bad since the types don't match. But I would expect the
nim compiler to complain, not the C compiler.
I am running on a Mac 10.14.4.
22:14:14 $ clang --version
(:|✔)
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Run