You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Jun 14, 2020
· 5 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Removing the generic component from the subclass makes it compile, as noted.
Changing the superclass initializer to take an AnyPublisher<Value, Never> parameter instead of a constrained InputPublisher: Publisher parameter also makes it compile.
The text was updated successfully, but these errors were encountered:
The code above is missing a few closing braces, but regardless it doesn't compile:
/Users/spare/Desktop/test.swift:5:8: error: generic parameter 'Input' is not used in function signature
init<Input, InputPublisher: Publisher>(initialValue: Value, inputPublisher: InputPublisher) {
^
Although once I remove the unused generic parameter, the code compiles fine on master, so I think the crash is fixed.
@theblixguy Oh no! Sorry about the non-compiling example — I had some copy-paste / Jira formatting issues. I updated the sample code above and pasted it into an Xcode 11.5 project to verify that it reproduces the Segmentation fault 11 error
Nice! No Segmentation fault using the latest development snapshot. My original use case that I condensed to a smaller reproducible example for this bug also also compiles successfully with the latest development snapshot. Looks like it must have already been fixed then ��
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Environment
Xcode 11.5 running on macOS Catalina.
Current version of Swift Playgrounds on iPad Pro
Additional Detail from JIRA
md5: ea8a56c0f958568461149465ff10c821
Issue Description:
import Combine
{{ }}class Test<Value> {
{{ @published private var value: Value}}
{{ init<InputPublisher: Publisher>(initialValue: Value, inputPublisher: InputPublisher) { }}
{{ value = initialValue}}
}
// This compiles
class OK: Test<String> {
{{ init() {}}
{{ super.init(initialValue: "", inputPublisher: ["a", "b", "c"].publisher)}}
}
// Segmentation fault: 11
class UhOh<T>: Test<String> {
{{ init() {}}
{{ super.init(initialValue: "", inputPublisher: ["a", "b", "c"].publisher)}}
}
Removing the generic component from the subclass makes it compile, as noted.
Changing the superclass initializer to take an
AnyPublisher<Value, Never>
parameter instead of a constrainedInputPublisher: Publisher
parameter also makes it compile.The text was updated successfully, but these errors were encountered: