motif icon indicating copy to clipboard operation
motif copied to clipboard

proposal to update generated function names

Open davissuber opened this issue 1 year ago • 0 comments

Note for reviewers: I have NOT tested this against Uber's apps at the time of this writing - this pull request is more of a "is this even a problem worth changing" type of deal - if this seems agreeable, I'll test out the code generation in buck/bazel.

The main behavioral change in this pull request is in the function name generation in Names.kt, one can run into the following problems:

  1. If one create a type named Null, it would break the keyword check since it's not in the keyword
    • Normally people probably won't do this - so this is probably not a real problem
    • We can also just add null to the keyword list as alternative
  2. A name that ends with 2 such as Function2 will pass through the uniqueness check and be converted as function22
    • This is not technically wrong or break anything, but feels like it reads worse than function2_2

davissuber avatar Mar 28 '24 23:03 davissuber