You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be some solutions to type inference exercises that are incorrect in the current version of the compendium, presumably due to more precise type inference in newer Scala compiler versions for union types.
I recall finding a few of these errors in the past, but this is the only one I have noted down (Exercise 2C, W08):
The solution says:
However, when trying this myself using Scala REPL the compiler infer more precise types than Any and AnyVal:
I personally think that solutions to exercises like these have to be revised in order to not confuse students. Maybe we can include both the general and the precise type?