TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Strange behaviour compiling in xCode

Forums > Swift

Hi.

I have a project that I use in a MS Onedrive that syncs between 2 machines. I do this so I can work at home on the code, then take it on. the road. That's been working fine for me for the last 5 months.

But now, on one machine (M1 iMac 16gb) the project compiles and works fine, but on the second machine (M2 Air 8GB) when I try to compile I get the error.

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

On one of the files in the project.

Thing is the two files are exacly the same. I've even used a text compare app and it reports the files as identical.

What could be going wrong?

Both machines are running macOS 13.3 (22E252) Xcode 14.

Any ideas?

ps. I will try on a third machine later today (MBP M1 16GB)

edit: The error message points to the top level view, not to any specific line in the code.

3      

Please post some code. Especially with that error, it's almost impossible to say what could be wrong.

3      

@roosterboy, I get it, but i'd have to post the entire 378 line Swift file because I mentioned the error is mentioned at the top view

    var body: some View {
        NavigationView {

            // Spinner is displayed on device shake
            ...
            ...

at

    var body: some View {

I checked this AM and it complies well on a third machine.

I have spent some time removing sections to see if the error remains... so far it does.

3      

If I had to guess, it's because an 8gb machine is really kind of marginal for some of the work SwiftUI needs to perform.

I know that specific compiler performance was improved in Swift 5.8, so that's another possibility (upgrading that project, if possible).

3      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.