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-14291] Compiler doesn't tell where the error occurs. #56650

Closed
YOCKOW opened this issue Mar 1, 2021 · 1 comment · Fixed by #68889
Closed

[SR-14291] Compiler doesn't tell where the error occurs. #56650

YOCKOW opened this issue Mar 1, 2021 · 1 comment · Fixed by #68889
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation error handling inheritance Feature → type declarations → class: Subclassing and inheritance of class members init Feature → declarations: Initializers swift 6.0 type checker Area → compiler: Semantic analysis

Comments

@YOCKOW
Copy link
Collaborator

YOCKOW commented Mar 1, 2021

Previous ID SR-14291
Radar rdar://problem/74876041
Original Reporter @YOCKOW
Type Bug
Environment

Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin20.3.0

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

md5: 9a5fd6b71ce55da5783b9975045cb234

Issue Description:

Try to compile the following code:

class C {
  init() throws {}
}

class D: C {
  let i: Int
  init(i: Int) {
    self.i = i
  }
}

The compiler views error like
<unknown>:0: error: call can throw, but it is not marked with 'try' and the error is not handled.

D seems to call super.init implicitly, but the error message doesn't imply it.

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added swift 5.9 type checker Area → compiler: Semantic analysis definite initialization labels Sep 10, 2023
@AnthonyLatsis AnthonyLatsis added inheritance Feature → type declarations → class: Subclassing and inheritance of class members init Feature → declarations: Initializers declarations Feature: declarations and removed definite initialization labels Sep 27, 2023
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 declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation error handling inheritance Feature → type declarations → class: Subclassing and inheritance of class members init Feature → declarations: Initializers swift 6.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants