Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for reserved words being used #36

Open
adamconnelly opened this issue Sep 17, 2020 · 0 comments
Open

Check for reserved words being used #36

adamconnelly opened this issue Sep 17, 2020 · 0 comments

Comments

@adamconnelly
Copy link
Owner

We should be able to add a check for various reserved words being used or other problems that will end up causing C# compilation errors. For example the following enum will cause a compilation error because it uses the reserved word class as its name:

enum class {
  Class1,
  Class2
}

In that particular situation we've got at least the following options:

  1. Just don't allow it, and output an error message.
  2. Rename class to @class in the generated code.
  3. Rename to @class, and output a warning that we're having to automatically rename it.

Options 2 and 3 are probably the best option to support cross-platform thrift files where a name might use a reserved word in one language but not another, but obviously the first option is the simplest.

There may also be other situations where renaming like that isn't an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant