Open Agarunov opened 5 years ago
The problem here is we have an implicit tuple expression (wrappedValue,other). wrappedValue comes from the assigned value which is why I think it seems to be pointing the fix-it to the value. There's a few ways to fix this:
1. Emit fix-its to insert `initialValue: 100` before `other`
What do you think @xedin? Do you have any other ideas?
@theblixguy I think from usability standpoint #1 makes most sense, fix-it should form `@A(initialValue: 100, other: 0) var some: Int`
@xedin Sounds good! Although I don't have access to the variable inside diagnoseArgumentLabelError()
. That is required to remove the '= 100' part. In LabelingFailure
, we only have access to the CallExpr
, but not the PatternBindingDecl
.
Me and @DougGregor talked about this yesterday. It seems that the best option to solve this would be to actually start type-checking patterns via constraint solver.
Environment
Swift 5.1 25.07.2019 Master 06.08.2019Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, PropertyWrappers | |Assignee | None | |Priority | Medium | md5: 78089d8ad73de168d37631a50f8c728aIssue Description:
This code provides incorrect fix-it:
If I apply fix-it:
If I change initialValue in init to wrappedValue everything compile correctly