Invalid C code when naming a object member "linux" #5171

Closed
trustable-code opened this Issue Jan 1, 2017 · 0 comments

Projects

None yet

1 participant

@trustable-code
Member

This example code does not work:

type MyType = object
  linux: bool
var x: MyType
x.linux = true

GCC fails to compile the generated C code:
error: expected identifier or ‘(’ before numeric constant
Problem is the object member named "linux".
I would expect, that "linux" can be used as identifier without issues.

Tested with Nim Devel from 2016-12-28 on Linux x64.

@Araq Araq added a commit that closed this issue Jan 3, 2017
@Araq Araq fixes #5171 9c0319d
@Araq Araq closed this in 9c0319d Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment