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
In the code below, Functor has a generic parameter Container that takes type constructors of the form Container<Element>. This works well for types like Singleton, List, and Set.
Pair is a class with two generic parameters (Pair<A,B>) - one more of course than Container.
In order to satisfy Container with Pair, a type lambda is necessary to resolve this difference. PairLambda performs this task, capturing PairFunctor's A for Pair's first type parameter, and designating Pair's second type parameter as Container's Element.
ceylon.language::Float
snapjs.base-0.0.1.js:5370
$16l1={t:Pair,a:{B$Pair:'E$PairLambda',A$Pair:pairFunctor$.$$targs$$.A$PairFun
^
TypeError: Cannot read property 'A$PairFunctor' of undefined
at pairFunctor$.PairLambda$PairFunctor (snapjs.base-0.0.1.js:5370:138)
at testPairFunctor (snapjs.base-0.0.1.js:5385:75)
at [eval]:1:366
If PairLambda is rewritten to not capture PairFunctor.A, the program works. With:
sharedaliasPairLambda<E> => Pair<String,E>;
you get:
ceylon.language::Float
ceylon.language::Float
The text was updated successfully, but these errors were encountered:
In the code below,
Functor
has a generic parameterContainer
that takes type constructors of the formContainer<Element>
. This works well for types likeSingleton
,List
, andSet
.Pair
is a class with two generic parameters (Pair<A,B>
) - one more of course thanContainer
.In order to satisfy
Container
withPair
, a type lambda is necessary to resolve this difference.PairLambda
performs this task, capturingPairFunctor
'sA
forPair
's first type parameter, and designatingPair
's second type parameter asContainer
'sElement
.This type checked code:
results in:
If
PairLambda
is rewritten to not capturePairFunctor.A
, the program works. With:you get:
The text was updated successfully, but these errors were encountered: