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

use psi based type reference to defer type resolution #1506

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

neetopia
Copy link
Contributor

No description provided.

@@ -15,18 +17,18 @@ class KSCallableReferenceImpl private constructor(
cache.getOrPut(IdKeyPair(ktFunctionalType, parent)) { KSCallableReferenceImpl(ktFunctionalType, parent) }
}
override val receiverType: KSTypeReference?
get() = ktFunctionalType.receiverType?.let { KSTypeReferenceImpl.getCached(it) }
get() = ktFunctionalType.receiverType?.let { KSTypeReferenceResolvedImpl.getCached(it) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the purpose of deferring and restoring, all type references in sources (be it java or kotlin) need to be implemented by KSTypeReferenceImpl.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, KSCallableReferenceImpl can not take KtFunctionalType for sources, because it is subject to change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KtCallableReference is left as TODO in this PR.

@ting-yuan
Copy link
Collaborator

KSTypeReferenceImpl.defer() needs to be implemented. Other than that LGTM.

@neetopia neetopia merged commit bc16a18 into google:main Nov 1, 2023
3 checks passed
@neetopia neetopia deleted the type-ref-refactor branch November 1, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants