Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hazarth94743yThe compiler can't modify the source code. For all it knows, maybe that samicolon error is caused by something completely different. A missing quote in an unrelated string? Maybe incorrect paths in the compile files due to a build script error? Could be any amount of things that might report a missing semi despite that not being the problem. If the compiler just silently made your code compile it might cause more damage than good.
Honestly the best practice is to trust that programmer knows best and just point out problems preventing running the software. -
what hazard said.
although technically it could, but it wouldn't be right to do so.
also, it can't be sure that the missing semicolon is the actual problem, the problem might be far before it in some other syntax mistake which didn't make the tokenizer outright halt, but it confused it in a way which hardfaulted X tokens later on expecting a semicolon in the wrongly parsed segment. -
Because trying to fix bugs automatically is a pretty bad idea at the current state of AI tech.
-
That's what ecmascript does. When it encounters an invalid token it tries inserting a semicolon to see if that solves it
-
asgs115633y
-
Related Rants
Instead of throwing an error, why doesn't the compiler add a semicolon to solve it?
question
compiler