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-3245] Misplaced fix-it for referencing ".init" on instances #45833

Closed
rintaro mannequin opened this issue Nov 19, 2016 · 1 comment
Closed

[SR-3245] Misplaced fix-it for referencing ".init" on instances #45833

rintaro mannequin opened this issue Nov 19, 2016 · 1 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

Comments

@rintaro
Copy link
Mannequin

rintaro mannequin commented Nov 19, 2016

Previous ID SR-3245
Radar None
Original Reporter @rintaro
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 3.0.1 (swift-3.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee slazarus (JIRA)
Priority Medium

md5: 6b927cab0cca019c15c47de969eaea8c

relates to:

  • SR-3236 Bogus diagnostics for referencing ".init" on instances

Issue Description:

Given

let a = 1
a.init()

emits:

test.swift:2:1: error: 'init' is a member of the type; use 'type(of: ...)' to initialize a new object of the same dynamic type
a.init()
^
  type(of:  )

This fix-it tries to enclose init; a.type(of: init)()

Instead, it should be:

type(of: a).init()
@rintaro
Copy link
Mannequin Author

rintaro mannequin commented Nov 29, 2016

mamuncseruet03 (JIRA User) Thank you for taking this task!
If you need any assistance, please don't hesitate to ask for it here.

@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

0 participants