[Sema] Fix for non-API level property wrappers with closure. #63149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I was using property wrappers in my code and encountered a compiler crash. Here is a code to reproduce it:
I have dumped an AST for this code and noticed that it tries to apply a property wrapper of the wrong type to an argument,
i.e. it tries to apply
Int
wrapper to anInt
argument:Such output produced only for non API-level property wrappers. It makes no sense for me, so I have considered it as a bug.
I have checked test files and noticed that they does not contain tests for non API-level property wrappers as parameters.
I have added more tests to cover such wrappers and encountered few other crashes.
I have changed few conditions that affect property wrapper application. Now argument declaration seems to be in order:
Here are my changes to fix this crash.