xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.79k stars 1.33k forks source link

Consider submitting Eureka to the Swift Source Compatibility Suite #2056

Closed bjhomer closed 3 years ago

bjhomer commented 4 years ago

It appears that Xcode 12.0 beta 2's compiler is choking on some of the generics code used in Eureka (5.2.1). I know this has happened in the past; it appears that Eureka's use of generics is a good stress test of the Swift compiler. Have you considered submitting Eureka to the Swift Source Compatibility Library? It might help ensure that the Swift compiler continues to support the features used in Eureka.

bjhomer commented 4 years ago

It appears that the compiler is choking on this section: https://github.com/xmartlabs/Eureka/blob/master/Source/Core/SelectableSection.swift#L76-L79

1.  Apple Swift version 5.3 (swiftlang-1200.0.16.13 clang-1200.0.22.25)
2.  While evaluating request TypeCheckSourceFileRequest(source_file ".../Pods/Eureka/Source/Core/SelectableSection.swift")
3.  While evaluating request TypeCheckFunctionBodyUntilRequest(Eureka.(file).SelectableSectionType extension.selectedRows()@.../Pods/Eureka/Source/Core/SelectableSection.swift:76:17, )
4.  While type-checking statement at [.../Pods/Eureka/Source/Core/SelectableSection.swift:76:51 - line:79:5] RangeText="{
        let selectedRows = self.filter { $0 is SelectableRow && $0.baseValue != nil }
        return selectedRows.map { $0 as! SelectableRow }
    "
5.  While type-checking declaration 0x7f8c6f8318f8 (at .../Pods/Eureka/Source/Core/SelectableSection.swift:77:9)
6.  While evaluating request PatternBindingEntryRequest((unknown decl), 0)
7.  While type-checking expression at [.../Pods/Eureka/Source/Core/SelectableSection.swift:77:28 - line:77:85] RangeText="self.filter { $0 is SelectableRow && $0.baseValue != nil "
bjhomer commented 4 years ago

I also filed https://bugs.swift.org/browse/SR-13170 related to this particular crash

mats-claassen commented 4 years ago

Thanks for filing the issue in the Swift Bug report. We have had a few issues with the compiler in the past. Will consider submitting to the Source Compatibility Library.

I haven't got Xcode 12 beta 2 yet but the issue seems to be related to type-checking in those lines you mentioned. Maybe separating the statements in multiple lines might help the compiler.

johnlietzke commented 4 years ago

Did separating the lines work? An example would be helpful for future users.

nighthawk commented 4 years ago

FWIW, I had to do these two changes to SelectableSection.swift in Xcode 12 beta 2 for it to compile:

johnlietzke commented 4 years ago

@nighthawk Thanks, that fixed the problem. More efficiently than I was had done which was with multiple if statements.

mats-claassen commented 3 years ago

Eureka has been submitted to the Swift Source Compatibility Suite