Skip to content

[CSGen] SE-0213: Literal initialization via coercion shouldn't try br… #63762

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
Feb 28, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 17, 2023

…idging

addExplicitConversionConstraint generates a disjunction to
check whether type could be coerced via bridging. That is not
useful for literal initialization which could use direct equality if
the type of cast is valid because necessary conformance checks
have been performed before the transformation.

…idging

`addExplicitConversionConstraint` generates a disjunction to check
whether type could be coerced via bridging. That is not useful for
literal initialization which could use direct equality if the type
of cast is valid because necessary conformance checks have been
performed before the transformation.
@xedin xedin requested a review from hborla as a code owner February 17, 2023 23:14
@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2023

@swift-ci please test source compatibility

// CHECK: Type Variables:
// CHECK: [[LITERAL_VAR]] [allows bindings to: {{.*}}] as UInt32 {{.*}}
// CHECK-NOT: disjunction (remembered) \[\[locator@{{.*}} [Coerce@{{.*}}\]\]]:
_ = UInt32(0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this could have been a unit test but unfortunately CoerceExpr::forLiteralInit depends on valid source locations...

@xedin
Copy link
Contributor Author

xedin commented Feb 18, 2023

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 18, 2023

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 20, 2023

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 27, 2023

@swift-ci please smoke test macOS platform

@xedin xedin merged commit dc85cb0 into swiftlang:main Feb 28, 2023
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.

2 participants