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
scala>typeConst[t] = { typeL[x] = t }
defined typealiasConst
scala>typeBar[a] =Const[Int]#L[a]
-- [E052] ReferenceError: <console>:5:15--------------------------------------5|typeBar[a] =Const[Int]#L[a]
|^^^^^^^^^^^^^^^|Const[Int]#L does not take typeparameters
Interestingly if we "partially apply" this Const the result is neither in * nor in * → *:
scala>typeFoo=Const[Int]#L
defined typealiasFoo
scala>vala:Foo[Int] =1-- [E052] ReferenceError: <console>:6:7---------------------------------------6|vala:Foo[Int] =1|^^^^^^^^|Foo does not take typeparameters
scala>vala:Foo=1-- [E055] SyntaxError: <console>:6:7------------------------------------------6|vala:Foo=1|^^^| missing typeparameterforFoo
(Note that in Dotty we would just define Const as type Const[C] = [X] => C which works as expected, the above is a way to encode a constant type function in scalac)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Interestingly if we "partially apply" this
Const
the result is neither in*
nor in* → *
:(Note that in Dotty we would just define
Const
astype Const[C] = [X] => C
which works as expected, the above is a way to encode a constant type function in scalac)The text was updated successfully, but these errors were encountered: