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

the typeOf method be confused by Class generics #1426

Open
oooplz opened this issue Dec 5, 2022 · 2 comments
Open

the typeOf method be confused by Class generics #1426

oooplz opened this issue Dec 5, 2022 · 2 comments
Labels

Comments

@oooplz
Copy link

oooplz commented Dec 5, 2022

Describe the bug

typeOf method has totally different result when a class has generics

To Reproduce

annotation class Anno

@Anno
class Foo

@Anno
class Bar<T>

println(typeOf<Foo>().asTypeName().toString()) // Foo  ps. Expected
println(typeOf<Bar<*>>().asTypeName().toString()) // @Anno Bar<*>  ps. Unexpected

Expected behavior

annotation class Anno

@Anno
class Foo

@Anno
class Bar<T>

println(typeOf<Foo>().asTypeName().toString()) // Foo
println(typeOf<Bar<*>>().asTypeName().toString()) // Bar

Additional context
Add any other context about the problem here.

@oooplz oooplz added the bug label Dec 5, 2022
@ZacSweers
Copy link
Collaborator

This seems more like an inconsistency with typeOf()?

@oooplz oooplz changed the title the asTypeName method be confused by Class generics the typeOf method be confused by Class generics Dec 6, 2022
@oooplz
Copy link
Author

oooplz commented Dec 6, 2022

Yes, it's make more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants