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-6099] Segmentation Fault 11, emanating from SIL generation #48654

Closed
swift-ci opened this issue Oct 9, 2017 · 0 comments
Closed

[SR-6099] Segmentation Fault 11, emanating from SIL generation #48654

swift-ci opened this issue Oct 9, 2017 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Oct 9, 2017

Previous ID SR-6099
Radar None
Original Reporter shawnatpowerschool (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Apple Swift version 4.0 (swiftlang-900.0.65 clang-900.0.37)

Target: x86_64-apple-macosx10.9 on 10.12.6 (16G29).

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

md5: fc4038930e44975af4362d54e9b99268

duplicates:

  • SR-4387 Compiler Segmentation Fault 11 on wrongly ordered lets

Issue Description:

With the following code sample, the Swift compiler will seg fault.

The intention of the sample is poorly reasoned; occluding a instance field with a locally unwrapped optional of a different type, I suspect, is not "good practice". That said, I suspect/ expect that the compiler should allow it to be defined as that new type in scope - to disambiguate the two by dereferencing `self` for the instance field.

class Foo {
  var a: String? = nil
  func makeBar() -> Bar? {
    guard let aString = a,
    let a = Int(aString) else { return nil }
    return Bar(b: a)
  }
}

class Bar {
  let b: Int
  init(b: Int) {
    self.b = b
  }
}

{{ }}

@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.
Projects
None yet
Development

No branches or pull requests

1 participant