Skip to content

Partially Revert #27862 #28171

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

Merged
merged 1 commit into from
Nov 11, 2019
Merged

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 9, 2019

When SE-110 was being implemented, we accidentally began to accept
closure parameter declarations that had no associated parameter names,
e.g.

foo { ([Int]) in /**/ }

This syntax has never been sanctioned by any version of Swift and should
be banned. However, the change was made long enough ago and there are
enough clients relying on this, that we cannot accept the source break
at the moment. For now, add a bit to ParamDecl that marks a parameter
as destructured, and back out setting the invalid bit on the type repr
for these kinds of declarations.

To prevent further spread of this syntax, stub in a warning that offers
to insert an anonymous parameter.

Resolves part of rdar://56673657 and improves QoI for errors like
rdar://56911630

@CodaFi CodaFi requested a review from xedin November 9, 2019 01:34
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 9, 2019

@swift-ci please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM! Let's try to address new crasher soon though.

@@ -5214,7 +5214,7 @@ enum class ParamSpecifier : uint8_t {

/// A function parameter declaration.
class ParamDecl : public VarDecl {
Identifier ArgumentName;
llvm::PointerIntPair<Identifier, 1, bool> ArgumentNameAndDestrutured;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "c" is missing Destrutured :)

@@ -6,6 +6,7 @@
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors

// rdar://56144412
// XFAIL: asserts
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that this case started crashing again and has to be moved to "compiler_crashers"? 😢

When SE-110 was being implemented, we accidentally began to accept
closure parameter declarations that had no associated parameter names,
e.g.

foo { ([Int]) in /**/ }

This syntax has never been sanctioned by any version of Swift and should
be banned.  However, the change was made long enough ago and there are
enough clients relying on this, that we cannot accept the source break
at the moment.  For now, add a bit to ParamDecl that marks a parameter
as destructured, and back out setting the invalid bit on the type repr
for these kinds of declarations.

To prevent further spread of this syntax, stub in a warning that offers
to insert an anonymous parameter.

Resolves part of rdar://56673657 and improves QoI for errors like
rdar://56911630
@CodaFi CodaFi force-pushed the one-one-ten-ded-consequences branch from d6a36e1 to dd1b157 Compare November 11, 2019 06:11
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 11, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 11, 2019

⛵️

@CodaFi CodaFi merged commit 5a1cae1 into swiftlang:master Nov 11, 2019
@CodaFi CodaFi deleted the one-one-ten-ded-consequences branch November 11, 2019 07:47
@barek2
Copy link

barek2 commented Aug 10, 2024

LGTM! Let's try to address new crasher soon though.

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.

3 participants