Skip to content
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

[SR-12004] Indicating unnecessary errors with redefining/redeclaring existing operators #54439

Closed
swift-ci opened this issue Jan 10, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12004
Radar rdar://problem/58861151
Original Reporter wayne2046 (JIRA User)
Type Bug
Status Resolved
Resolution Cannot Reproduce

Attachment: Download

Environment

Xcode 11.3 (11C29) Playground

Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

Target: x86_64-apple-darwin18.7.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee wayne2046 (JIRA)
Priority Medium

md5: 04f634af4afc42de8fc2c1e6989b1200

Issue Description:

The snippet demonstrate that the Swift compiles the code successfully but shows some redundant errors when warning is enough in this case.

print("2 - 3 - 13 = \(2 - 3 - 13)")
print("24 / 4 * 2 = \(24 / 4 * 2)")

infix operator -: NilCoalescingPrecedence
infix operator /: NilCoalescingPrecedence

print("1 - 3 - 7 = \(1 - 3 - 7)")
print("24 / 4 * 3 = \(24 / 4 * 3)")

the output is:

2 - 3 - 13 = 12

24 / 4 * 2 = 3

1 - 3 - 7 = 5

24 / 4 * 3 = 2

@beccadax
Copy link
Contributor

@swift-ci create

@hborla
Copy link
Member

hborla commented Aug 12, 2020

This seems to be fixed in Xcode 12. I don't get those error messages in a playground or in an Xcode project when I paste in the code from the description.

Could you please verify using the latest Xcode 12 beta? Thank you!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants