[Bug potential] Wrap Marker/type names with(out) fully qualified path in class to prevent bugs
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Across the library, the names of types are usually stored as String. This can include things like:
`MyMarker`
`com.something.MyMarker`
but also
`` (typeArguments)
`` (typeParameters)
and all are simply stored as String.
This, however, can create unforeseen bugs, such as https://github.com/Kotlin/dataframe/issues/170 where some nested interface that should be referred to as ``` `My Type`.MyInterface``` is referred to as `My Type.MyInterface`, breaking code generation.
It's also not clear whether an argument called `name` stores a type with periods or not. Sometimes it's accompanied with `shortName` meaning `name` is fully qualified. Other times it's accompanied with `fqName` meaning `name` is a short name...
My suggestion is to either create a one-size-fits-all typing solution where ` quotes can be provided in any part of the type name, or use a library like KotlinPoet that can do it for us.
We already have a similar thing for `ValidFieldName`, but not for the types yet.
Contributor guide
Research direction
Start by auditing the library's String-based type-name handling, using the existing ValidFieldName implementation as a reference. Review the nested-interface failure in issue 170 and compare the two proposed approaches, then define consistent handling for simple, qualified, type-argument, and type-parameter names; done means code generation preserves valid names in all listed forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100