nalexn / ViewInspector

Runtime introspection and unit testing of SwiftUI views
MIT License
2.09k stars 145 forks source link

Fix type-checking timeout build error under Xcode 16 #308

Closed drhaynes closed 2 weeks ago

drhaynes commented 3 weeks ago

Fixes the Xcode 16 build error reported in https://github.com/nalexn/ViewInspector/issues/307:

ViewSearchIndex.swift:444:13: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
            .init(count: sheetModifiers.count, { index -> UnwrappedView in
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Issue is fixed by splitting the return statement out into sub-expressions.

nalexn commented 2 weeks ago

Thank you!