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
Type inference should work the same for zero and one, but it doesn't, foo(1).zero has expected type 1 but this isn't added as a constraint, so we instantiate T to Int (because the only constraint is >: 1 and we widen when instantiating a singleton lower bound)
When interpolating type variables we should use all available information
at this point, including the expected result type. One situation where this makes
a difference is if the expected type is a singleton type, because type variables
are instantiated to singleton types only if their upper bounds are singleton types.
Also fixesscala#2997.
Uh oh!
There was an error while loading. Please reload this page.
Type inference should work the same for
zero
andone
, but it doesn't,foo(1).zero
has expected type1
but this isn't added as a constraint, so we instantiateT
toInt
(because the only constraint is>: 1
and we widen when instantiating a singleton lower bound)The text was updated successfully, but these errors were encountered: