Closed Bug 1800904 Opened 2 years ago Closed 2 years ago

Should reserved keywords and other unusable variable names be allowed in event extras?

Categories

(Data Platform and Tools :: Glean: SDK, task)

task

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: brizental, Unassigned)

References

Details

This is especially fun given the lists of reserved words and variable names differ from language to language and platform to platform. For example, in C++, we can't use identifiers prefixed with two underscores, or a single underscore if in the global namespace.

Mitigations are also variable across languages and platforms. e.g. Swift (using backticks) and Rust (using a r# prefix) each have raw identifiers. But e.g. Kotlin doesn't.

See Also: → 1800862

What names to allow would vary between target languages (or be the union of all) and we would have to maintain that list.
Or escape where we can (Rust is fine, Swift is annoying because then it throws warning you can't suppress).

Right now we effectively already "disallow" certain names depending on the target by the pure fact that it fail the build then. I'm ok keeping it that way for now.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
See Also: → 1814767
You need to log in before you can comment on or make changes to this bug.