4 ms·
> they’re invalid swift If this isn't valid why are we even taking about it? The compiler should report syntax error or something
by tantalor 2y ago
> they’re invalid swift
If this isn't valid why are we even taking about it? The compiler should report syntax error or something
- deleted 2y ago[deleted]
- redwoolf 2y agoThat’s the point. It’s invalid swift syntax, but it takes >40 seconds to tell you that.
- Jtsummers 2y agoThe point is that it's valid syntax (invalid syntax is found in an earlier phase of compilation and would report much faster). It's invalid in Swift's type system, and it takes it 42 seconds (in the string example) and 8 seconds (in the math expression one) for it to tell you that it can't type-check it in a reasonable time and then it quits.
- tantalor 2y ago"Reasonable time" is subjective. What happens if you don't limit the time? Guesses: 1. Successfully compiles 2. Reports an error 3. Never halts 4. Nobody knows
- Dylan16807 2y agoIf there was just the right overload hiding somewhere, it wouldn't be an error and it would take a similar amount of time. This is just the easiest way to show off the problem, which is how long it takes to check.