Skip to content

recursively substitute functions for compute asMemberOf#1973

Merged
neetopia merged 1 commit into
google:mainfrom
neetopia:recursive-substitue-function
Jun 20, 2024
Merged

recursively substitute functions for compute asMemberOf#1973
neetopia merged 1 commit into
google:mainfrom
neetopia:recursive-substitue-function

Conversation

@neetopia

Copy link
Copy Markdown
Contributor

fixes #1919

@neetopia neetopia requested a review from ting-yuan June 18, 2024 02:10
@neetopia neetopia force-pushed the recursive-substitue-function branch 2 times, most recently from 22a0125 to 7dbad02 Compare June 18, 2024 02:11
// for functions we need to test both returnType and value parameters converges.
var funcToSub = (function as KSFunctionDeclarationImpl).ktFunctionSymbol.substitute(it)
var next = funcToSub.substitute(it)
while (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The complexity of this logic and also its dependency on the substitutor makes me worried whether it always converges. Can you add a counter to throw in case it doesn't?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds fair to me, I thought about the converge issue before but can't think about a fair number to exit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tentatively put 100 as a safe value.

@neetopia neetopia force-pushed the recursive-substitue-function branch from 7dbad02 to 4702102 Compare June 18, 2024 23:44
@neetopia neetopia merged commit b7e977c into google:main Jun 20, 2024
@neetopia neetopia deleted the recursive-substitue-function branch June 20, 2024 21:14
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.

[KSP2] KSFunctionDeclaration.asMemberOf does not return correct types

2 participants