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-10670] Incorrect diagnostic on explicit reference to 'init' with mismatching inout params #53069

Closed
hamishknight opened this issue May 11, 2019 · 2 comments
Assignees
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 type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-10670
Radar None
Original Reporter @hamishknight
Type Bug
Status Closed
Resolution Done
Environment

Swift version 5.0-dev (LLVM 082dec2e22, Swift c89f803897)
Target: x86_64-apple-darwin18.5.0

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

md5: b8158d3d8d97df80050f18f168b7f883

Issue Description:

The following yields an incorrect diagnostic:

struct S {
  init(_ x: inout String) {}
  init(_ x: inout [Int]) {}
}
var a = 0
S.init(&a)
main.swift:20:3: error: 'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type
S.init(&a)
  ^
  type(of:  )
main.swift:20:3: note: overloads for 'S.Type.init' exist with these partially matching parameter lists: (inout String), (inout [Int])
S.init(&a)
  ^
@belkadan
Copy link
Contributor

cc @xedin

@gregomni
Copy link
Collaborator

gregomni commented Jul 1, 2019

Fixed in #25903

@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 diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants