I tried to write some example code in SICP book with swift.
For example,
(2 + (4 * 6)) * ((3 + 5) + 7)
If I write this code in REPL,
then it displayed the result of calculating - 370 after 10~11 sec.
And If I write this code in swift file,
It's compile error like that
error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
What happened to type-check or type-inference here? why this fail to compile?
Anyway this is a workaround solution.
Int(2 + (4 * 6)) * Int((3 + 5) + 7)
Please let me know, How do I guess this type inference?
How do I try to looking which type check process like this case?
For example,
(2 + (4 * 6)) * ((3 + 5) + 7)
If I write this code in REPL,
then it displayed the result of calculating - 370 after 10~11 sec.
And If I write this code in swift file,
It's compile error like that
error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
What happened to type-check or type-inference here? why this fail to compile?
Anyway this is a workaround solution.
Int(2 + (4 * 6)) * Int((3 + 5) + 7)
Please let me know, How do I guess this type inference?
How do I try to looking which type check process like this case?