Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Xcode 14 Beta 1: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

Open Brian-Doig opened this issue 2 years ago • 8 comments

What did you do?

Attempted to compile our project using Xcode 14 beta 1 while using Charts as a Cocoapod.

What did you expect to happen?

Charts compiled

What happened instead?

/Users/bdoig/Documents/Projects/xxx/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift:340:39: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions internal static let EaseOutBack = { (elapsed: TimeInterval, duration: TimeInterval) -> Double in

I suspect the compiler can not infer the type of EaseOutBack and a specific type is required to be declared.

Charts Environment

Charts 3.6.0 Version 14.0 beta (14A5228q) Swift 5 iOS platform macOS 12.4

Brian-Doig avatar Jun 10 '22 16:06 Brian-Doig

This happens under Charts 4.0.3 as well.

Brian-Doig avatar Jun 10 '22 16:06 Brian-Doig

As noted this is with Xcode 14.0 beta 1, so Swift 5.7.

If I change ChartAnimationEasing line 340 to a func it allows it to compile. It seems like a Swift bug -- I don't see why this closure is different from the others in this file.

    internal static func EaseOutBack(elapsed: TimeInterval, duration: TimeInterval) -> Double {

erichedstrom avatar Jun 11 '22 18:06 erichedstrom

same here

michalnowak061 avatar Jun 12 '22 15:06 michalnowak061

It also works for me if I import Charts as a Swift Package instead of a Cocoapod.

The same error occurs if I add Charts as a Cocoapod to a brand new Xcode project, using latest Cocoapods 1.11.3.

I have submitted FB10209675 with the sample project using Cocoapods to Apple.

erichedstrom avatar Jun 12 '22 20:06 erichedstrom

This is a duplicate of #4835

erichedstrom avatar Jun 12 '22 20:06 erichedstrom

Same error with Xcode 14 beta 2

lchamp avatar Jun 23 '22 07:06 lchamp

Seems to be fixed in Xcode 14 beta 3.

Brett-Best avatar Jul 07 '22 10:07 Brett-Best

Same error with Xcode 14 beta 3

vmagnani avatar Jul 21 '22 12:07 vmagnani

closed by https://github.com/danielgindi/Charts/releases/tag/v4.1.0

pmairoldi avatar Sep 13 '22 02:09 pmairoldi