You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is the following code in CSSimplify's matchFunctionRepresentations.
caseConstraintKind::Subtype: {
autolast = locator.last();
if (!(last && last->is<LocatorPathElt::FunctionArgument>()))
returnfalse;
It's not clear when this code path affects the behavior of the compiler, if you comment the three lines out, the test suite still continues to pass. If this check is actually useful, we should add a test case exercising it and maybe a comment indicating when it is used. Otherwise, we should delete the code.
The text was updated successfully, but these errors were encountered:
Just forget everything above(I delete the comment because I made a mistake while looking into it), there are actually a lot of cases where the matching are done for Subtype, it just that all of then the representation is the same so it always allowed. But either way the only cases we can for sure validate early on type checking are argument function types, other cases should be as it is, allowed on typechecking and deferred to SIL because there compiler knows where it can diagnose or depending on the context the conversion is allowed because as mentioned by Slava, conversion is possible "we can emit a thunk that doesn’t capture context". So I think we maybe could maintain this check and just add an additional comment and it should be fine. I'll also try to come up with some test cases to exercise that. Sorry for the misunderstanding, I'll wait on your PR to land to avoid conflicts and look into this =]
Additional Detail from JIRA
md5: f53286905d7e83dd8b448b8cdb84257e
Issue Description:
There is the following code in CSSimplify's
matchFunctionRepresentations
.It's not clear when this code path affects the behavior of the compiler, if you comment the three lines out, the test suite still continues to pass. If this check is actually useful, we should add a test case exercising it and maybe a comment indicating when it is used. Otherwise, we should delete the code.
The text was updated successfully, but these errors were encountered: