Closed bjhomer closed 3 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 "
I also filed https://bugs.swift.org/browse/SR-13170 related to this particular crash
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.
Did separating the lines work? An example would be helpful for future users.
FWIW, I had to do these two changes to SelectableSection.swift
in Xcode 12 beta 2 for it to compile:
self.filter
with self.allRows.filter
s.forEach
with s.allRows.forEach
@nighthawk Thanks, that fixed the problem. More efficiently than I was had done which was with multiple if statements.
Eureka has been submitted to the Swift Source Compatibility Suite
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.