Skip to content

Conversation

@airspeedswift
Copy link
Member

Adds Equatable: ~Copyable. First step towards making Equatable, Comparable and Hashable noncopyable and nonescapable compliant.

@airspeedswift
Copy link
Member Author

@swift-ci Please test

@grynspan
Copy link
Contributor

Love it. Ship it.

@airspeedswift
Copy link
Member Author

@swift-ci please test

let _ = x < 2 // expected-error {{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
// expected-note@-1 {{coalesce using '??' to provide a default when the optional value contains 'nil'}} {{12-12= ?? <#default value#>}}
// expected-note@-2 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}} {{12-12=!}}
let _ = x < 2 // expected-error {{binary operator '<' cannot be applied to operands of type 'Int?' and 'Int'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like there's some dedicated diagnostic that we're no longer getting here, but I'm not sure how much value it was adding to begin with.

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.

4 participants