Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Combining object variants and inheritance leads to SIGSEGV during compilation #10033
Object variants and inheritance are both good ideas and work quite well, but putting them together seems to lead to SIGSEGV during compilation. In my tests, if A is an object variant and B is inherited from A, then writing certain attributes of B (probably the discriminator) will result in SIGSEGV during compilation.
type Token = enum Int, Float Base = ref object of RootObj case token: Token of Int: bInt: int of Float: bFloat: float Child = ref object of Base let c = new Child c.token = Int
What I'm trying to do in the code example might be illegal (although I couldn't find any reference in the manual), but I don't think it should result in a segmentation fault.
No idea. Thank you for your time for this!
Nim Compiler Version 0.19.0 [Linux: amd64]
git hash: f6c5c63
This also works:
so there seems to be a problem with a