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

Generic TypeAliases Parameter are not consistent resolved #1011

Closed
bitPogo opened this issue Jun 3, 2022 · 1 comment · Fixed by #1118
Closed

Generic TypeAliases Parameter are not consistent resolved #1011

bitPogo opened this issue Jun 3, 2022 · 1 comment · Fixed by #1118
Assignees
Labels
bug Something isn't working
Milestone

Comments

@bitPogo
Copy link

bitPogo commented Jun 3, 2022

Hey,
I stubbled over a problem with inherited TypeAlias arguments.
Imagine following:

typealias Alias93<T> = Map<String, T>
typealias Alias97 = (Any) -> Any

@AweomeAnnotaton
interface Sub : Super

@AweomeAnnotaton
interface Super {
  val prop: Alias93<String>
  fun doSomething(arg0: Alias97<Any>): Any
}

While the processor runs over it with getAllFunctions()/getAllProperties() it has some unexpected behaviour.
When resolving the KSPropertyDeclaration.type or the KSFunctionDeclaration.parameters (I am sure it applies KSFunctionDeclaration.returnType as well) the KSTypeReference.element.typeArguments will give a different output for Super and Sub. It looks like when inherited it uses the abbreviated Parameter.

@neetopia neetopia added the bug Something isn't working label Jun 4, 2022
@neetopia neetopia added this to the 1.0.7 milestone Jun 4, 2022
@ting-yuan ting-yuan self-assigned this Aug 16, 2022
neetopia added a commit to neetopia/ksp that referenced this issue Sep 23, 2022
@neetopia neetopia self-assigned this Sep 23, 2022
neetopia added a commit to neetopia/ksp that referenced this issue Sep 23, 2022
github-actions bot pushed a commit that referenced this issue Sep 23, 2022
@bitPogo
Copy link
Author

bitPogo commented Sep 23, 2022

Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants