Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Check for reserved words being used #36

Description

@adamconnelly

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions