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-11713] Bad error message and no fixit stubs when conforming to ExpressibleByStringLiteral #54122

Open
NevinBR opened this issue Nov 5, 2019 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation

Comments

@NevinBR
Copy link
Contributor

NevinBR commented Nov 5, 2019

Previous ID SR-11713
Radar rdar://problem/56923068
Original Reporter @NevinBR
Type Bug
Environment

Xcode 11.2

Swift 5.1.2

MacOS 10.14.6

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee None
Priority Medium

md5: f7ee4ff36006f5a278f81c4ac736becd

Issue Description:

When creating a new type that conforms to ExpressibleByStringLiteral (or extending an existing type to conform), there is initially a “does not conform” error with a fixit to add a typealias. After accepting that fixit and completing the typealias, I would expect another error with a fixit to add a stub for the init(stringLiteral:) method.

However, instead of a “does not conform” error, there is a very different error and no fixit:

struct Foo: ExpressibleByStringLiteral {
  typealias StringLiteralType = String
}
// Error: Initializer 'init(extendedGraphemeClusterLiteral:)' has different argument labels from those required by protocol 'ExpressibleByStringLiteral' ('init(stringLiteral:)')
@beccadax
Copy link
Contributor

beccadax commented Nov 5, 2019

Reproduced in the 11/1 master snapshot toolchain.

@beccadax
Copy link
Contributor

beccadax commented Nov 5, 2019

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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 diagnostics QoI Bug: Diagnostics Quality of Implementation
Projects
None yet
Development

No branches or pull requests

2 participants