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

Lookup of constructor JVM signature throws exception if not found #83

Closed
ZacSweers opened this issue Sep 26, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working P1 major features or blocking bugs
Milestone

Comments

@ZacSweers
Copy link
Contributor

ZacSweers commented Sep 26, 2020

Given this snippet

class Properties {
  var a: Int = -1
  var b: Int = -1
}

If one tries to look up the signature, KSP will throw an exception rather than just return null.

resolver.mapToJvmSignature(primaryConstructor)
e: java.lang.IllegalStateException: unexpected class: class com.google.devtools.ksp.symbol.impl.synthetic.KSConstructorSyntheticImpl
	at com.google.devtools.ksp.processing.impl.ResolverImpl.resolveFunctionDeclaration(ResolverImpl.kt:264)
	at com.google.devtools.ksp.processing.impl.ResolverImpl.mapToJvmSignature(ResolverImpl.kt:219)
@ting-yuan ting-yuan added bug Something isn't working P1 major features or blocking bugs labels Sep 28, 2020
@ting-yuan ting-yuan added this to the 2020Q4 milestone Oct 4, 2020
@neetopia neetopia closed this as completed Oct 9, 2020
@ZacSweers
Copy link
Contributor Author

What was the change with this one? I noticed the API still returns non-null, so not sure what the expected behavior is now

@ZacSweers
Copy link
Contributor Author

checked in my project, see it just returns the synthetic constructor 👍

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

No branches or pull requests

3 participants