marcoarment@mastodon.social
marcoarment@mastodon.social

Translation: "You screwed up somewhere in this entire file. Figure it out yourself. Good luck! 🤷”

It's the "Segmentation fault” of the modern era.

SwiftUI compilation error:

|
Embed
Progress spinner
marcoarment@mastodon.social
marcoarment@mastodon.social

i’m unable to type-check YOUR expression in reasonable time

|
Embed
Progress spinner
meaningful_jan@det.social
meaningful_jan@det.social

@marcoarment probably forgot the dot for a modifier or something 😬

|
Embed
Progress spinner
jamie_blumberg@hachyderm.io
jamie_blumberg@hachyderm.io

@marcoarment Oh cool, now I get to comment out portions of my code bit by bit until the error goes away, and hopefully that actually narrows down the cause of the problem.

SwiftUI continues to be fun and infuriating in seemingly equal measure.

|
Embed
Progress spinner
gklka@mastodon.social
gklka@mastodon.social

@marcoarment I just want a "then do it in unreasonable time" button

|
Embed
Progress spinner
marcoarment@mastodon.social
marcoarment@mastodon.social

(The actual problem, 67 lines below the error message: .disabled() needs to be applied to the Button, not the ToolbarItem, which I had to figure out by just commenting out random stuff until it compiled.)

|
Embed
Progress spinner
marcoarment@mastodon.social
marcoarment@mastodon.social

Maybe some of these new "intelligences" can be used to make SwiftUI's error messages useful

|
Embed
Progress spinner
matt@isfeeling.social
matt@isfeeling.social

@marcoarment AI can do a lot of things, but this may be an impossible task.

|
Embed
Progress spinner
Timschmitz@mastodon.social
Timschmitz@mastodon.social

@marcoarment I'm glad I'm not the only one who debugs that error this way 🤦‍♂️

|
Embed
Progress spinner
waynedixon@mastodon.social
waynedixon@mastodon.social

@marcoarment sadly, that seems to be the only way to debug the error. I’ve had to do that too many times to count.

|
Embed
Progress spinner
pvanb@mastodon.social
pvanb@mastodon.social

@marcoarment “Here's what I found on the web for ‘The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions’”

|
Embed
Progress spinner
In reply to
manton
manton

@marcoarment 🤣

|
Embed
Progress spinner
duckdotexe@mastodon.social
duckdotexe@mastodon.social

@marcoarment What language is this? I don't recognize the syntax.

|
Embed
Progress spinner
michaelrowe01@mstdn.social
michaelrowe01@mstdn.social

@marcoarment I feel randomly commenting out code helps a lot with SwiftUI ;)

|
Embed
Progress spinner
dordio@masto.pt
dordio@masto.pt

@marcoarment this is all very much plausible and warranted for.

|
Embed
Progress spinner
bobdel@mastodon.social
bobdel@mastodon.social

@marcoarment Not just “this file.” I lost a day to a missing optional symbol (typo) in a model file that showed up as this error on the app’s main view.

|
Embed
Progress spinner
kp@mastodon.design
kp@mastodon.design

@marcoarment I binary search my way through this error 😅

|
Embed
Progress spinner
tomjacob@mastodon.social
tomjacob@mastodon.social

@marcoarment tbh why can’t apple intelligence be used to give better error messages? Can’t it suck in your code, whatever it can from the compiler and give a probabilistic idea of what’s going wrong?

|
Embed
Progress spinner
voidstern@graz.social
voidstern@graz.social

@marcoarment Not even that. Also happens with complex but correct code ¯\_(ツ)_/¯

|
Embed
Progress spinner
eclair4151@infosec.exchange
eclair4151@infosec.exchange

@marcoarment I actually have had a surprising amount of success when these errors happen just copying the entire file into ChatGPT or CoPilot and asking it to find the error for me.

|
Embed
Progress spinner
caseyliss@mastodon.social
caseyliss@mastodon.social

@marcoarment does this mean it’s @siracusa’s turn tomorrow

mastodon.social/@caseyliss/113

|
Embed
Progress spinner
apike@mastodon.social
apike@mastodon.social

@marcoarment For a simple API-typo issue like this, in an IDE like Cursor.sh in a language like Python or TypeScript, nowadays you would get an underline "fix this" that would indeed fix it (or maybe even a tab-complete suggestion to fix it)

|
Embed
Progress spinner
mberk@iosdev.space
mberk@iosdev.space

@marcoarment

|
Embed
Progress spinner
chucker@norden.social
chucker@norden.social

@marcoarment OK! Playing “She’s My Type” by Kurt Reston

|
Embed
Progress spinner
Porkwich@mastodon.social
Porkwich@mastodon.social

@marcoarment I’d rather have useless messages than “confidently wrong” messages

|
Embed
Progress spinner
awhite@mastodon.social
awhite@mastodon.social

@marcoarment

|
Embed
Progress spinner
kenryall@mastodon.world
kenryall@mastodon.world

@marcoarment Definitely annoying. Our team found that we can defend against this by breaking up Views into smaller pieces. We end up with code that is better organized and more readable too.

|
Embed
Progress spinner
spitfire@mastodon.social
spitfire@mastodon.social

@marcoarment Oof, you don’t want an LLM in your compiler.

|
Embed
Progress spinner
actinglikecrazy@aus.social
actinglikecrazy@aus.social

@marcoarment
compilers trying to type check it in a reasonable time: <10 seconds
Humans trying to type check it mentally it in a reasonable time: <30 minutes

|
Embed
Progress spinner
stevex@mastodon.social
stevex@mastodon.social

@marcoarment If you just dropped the file with the error into Claude, does it detect the error? Having it diagnose an error automatically could quite possibly be great.

|
Embed
Progress spinner
williamw@mastodon.social
williamw@mastodon.social

@meaningful_jan @marcoarment or put a comma after something where you’re supposed to leave it out

|
Embed
Progress spinner
MuseumShuffle@mastodon.social
MuseumShuffle@mastodon.social

@marcoarment i’ve gotten to the point with my project where I’m really hesitant to make too many changes without checking them in because I worry that I’ll hit this error and have no idea what caused it in all the changes I made.

|
Embed
Progress spinner
harishchak@mastodon.social
harishchak@mastodon.social

@marcoarment this blog explains the problem well. danielchasehooper.com/posts/wh

|
Embed
Progress spinner
chockenberry@mastodon.social
chockenberry@mastodon.social

@caseyliss @marcoarment @siracusa Will someone please complain about this so that I don't feel so alone.

|
Embed
Progress spinner
danteusz@mastodon.social
danteusz@mastodon.social

@chockenberry @caseyliss @marcoarment @siracusa Looks like it’s fixed developer.apple.com/documentat

|
Embed
Progress spinner
titociuro@mstdn.social
titociuro@mstdn.social

@marcoarment If one invokes a method from say, a button and add/remove/modify a parameter from that method you’ll also be greeted with this nonsense. I never understood why it’s so difficult to get a “yo, a parameter is missing right here”. No one is curious enough to fix this?

|
Embed
Progress spinner
MyLittleMetroid@sfba.social
MyLittleMetroid@sfba.social

@marcoarment not only we designed a language that has a really hard time inferring all the types, but we decided to write code in the hardest possible way for the compiler to figure out.

And then we added function builders to make it harder to actually break the expression into subexpressions 🤷🏻‍♂️

|
Embed
Progress spinner