swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.3k stars 10.34k forks source link

[SR-10989] Combine framework error on Xcode 11 beta #53379

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-10989
Radar rdar://problem/49639321
Original Reporter nhatlee89 (JIRA User)
Type Bug

Attachment: Download

Environment
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | Compiler | |Labels | Bug, RunTimeCrash | |Assignee | None | |Priority | Medium | md5: 81f51f6edd5f3683bb9b910a85997c55

Issue Description:

I am trying use combine framework on Xcode 11 beta(MacOS: 10.15 Beta (19A471t)) but got the error as the image below:

belkadan commented 5 years ago

Not sure yet if this crash is due to the compiler or due to Combine, but let's find out.

belkadan commented 5 years ago
import Combine

class Foo {
  @Published var passW: String = ""
  func doSth() {
    passW = "1234"
    $passW.sink {
      print("value: \($0)")
    }
  }
}
let fo = Foo()
fo.doSth()
belkadan commented 5 years ago

Did not obviously reproduce for me. nhatlee89 (JIRA User), is this in a playground or a project? Can you attach it?

belkadan commented 5 years ago

Okay, it does reproduce in an iOS playground. So maybe it's playground-specific, or maybe I still haven't narrowed it down enough.

belkadan commented 5 years ago

Aha, looks like @jirid has a fix for this already! (reviewed by @slavapestov) Let's get that into the 5.1 branch too once it goes in on master.