LambdaTest2 funktioniert nicht #164
Labels
No Label
Codegen
confirmed
duplicate
Eclipse-Plugin
Feature Request
generics
in progress
invalid
JavaCompilerCore
needs info
Parser
Trash
Type
Unify
won't fix
works for me
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JavaTX/JavaCompilerCore#164
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
class LambdaTest<A,B>{
Fun1<Fun1<A, Fun2<A, LambdaTest<A,B>, B>>, B> op = (m) -> (f) -> f.apply(this,m);
}
Es kommt zu
[
(Fun1< Fun1< TPH A1399499405, Fun2< TPH A1399499405, LambdaTest< TPH A1399499405, TPH B1399499405 >, TPH B1399499405 > >, TPH B1399499405 > <. Fun1< Fun1< TPH A1399499405, Fun2< TPH A1399499405, LambdaTest< TPH A1399499405, TPH B1399499405 >, TPH B1399499405 > >, TPH B1399499405 >),
(TPH ABJ <. Fun1< Fun1< TPH A1399499405, Fun2< TPH A1399499405, LambdaTest< TPH A1399499405, TPH B1399499405 >, TPH B1399499405 > >, TPH B1399499405 >),
(Fun1< ? extends TPH ABN, ? super TPH C > <. TPH ABJ),
(TPH C <. TPH T232863545),
(TPH B <. Fun2< TPH R32863545, TPH T132863545, TPH T232863545 >),
(TPH R32863545 <. TPH ABL),
(TPH ABL <. TPH ABM),
(Fun1< ? extends TPH ABM, ? super TPH B > <. TPH ABK),
(TPH ABK <. TPH ABN),
(LambdaTest< TPH A32863545, TPH B32863545 > <. TPH T132863545)]
[
(TPH C <. TPH T232863545),
(TPH R32863545 <. TPH ABL),
(TPH ABL <. TPH ABM),
(Fun1< ? extends TPH ABM, ? super Fun2< TPH R32863545, LambdaTest< TPH A32863545, TPH B32863545 >, TPH T232863545 > > <. TPH ABN),
(TPH ABJ = Fun1< Fun1< TPH A1399499405, Fun2< TPH A1399499405, LambdaTest< TPH A1399499405, ? super TPH C >, ? super TPH C > >, ? super TPH C >),
(Fun1< TPH A1399499405, Fun2< TPH A1399499405, LambdaTest< TPH A1399499405, ? super TPH C >, ? super TPH C > > = ? extends TPH ABN),
(TPH B1399499405 = ? super TPH C),
(TPH B = Fun2< TPH R32863545, LambdaTest< TPH A32863545, TPH B32863545 >, TPH T232863545 >),
(TPH ABK = Fun1< ? extends TPH ABM, ? super Fun2< TPH R32863545, LambdaTest< TPH A32863545, TPH B32863545 >, TPH T232863545 > >),
(TPH T132863545 = LambdaTest< TPH A32863545, TPH B32863545 >)]
2.Schritt von TUnify ergibt
[
(TPH R1860513229 <. TPH ABJ),
(TPH B <. Fun2< TPH R1860513229, TPH T11860513229, TPH T21860513229 >),
(LambdaTest< GTV A, GTV B > <. TPH T11860513229),
(TPH C <. TPH T21860513229),
(Fun1< ? extends TPH ABL, ? super TPH C > <. TPH ABH),
(TPH ABI <. TPH ABL),
(Fun1< ? extends TPH ABK, ? super TPH B > <. TPH ABI),
(TPH ABJ <. TPH ABK),
(TPH ABH <. Fun1< Fun1< GTV A,
Fun2< GTV A, LambdaTest< GTV A, GTV B >, GTV B > >,
GTV B >)]
Daraus kommt es dann über TPH ABH zu:
(Fun1< ? extends TPH ABL, ? super TPH C > =.
(TPH ABH <. Fun1< Fun1< GTV A,
Fun2< GTV A, LambdaTest< GTV A, GTV B >, GTV B > >,
GTV B >)]
Das ergibt:
? extends TPH ABL =. Fun1< GTV A,
Fun2< GTV A, LambdaTest< GTV A, GTV B >, GTV B > >
und
? super TPH C =. GTV B
Beides nicht lösbar.
Evlt. muss bei TYPE in der Lambda-Regel FunN<? ext Retty, ? super Argtyp>
auch nich FunN<rettyp, Argtyp> eingefügt werden, da
Rettyp keine Instanz von ? ext Rettyp und
Argtype keine Instanz ? super Argtyp ist.
Ich denke hier ist an der falschen Stelle in TYPEExpr das ODER-Constraint eingefügt worden.
Es sollte bei FunN<? Ext Ty, ? Super TY'> oder FunN<Ty, TY'> nicht bei den Argumenten eingefügt werden.
Bitte nochmals Rücksprache!
Folgendes wird implementiert in
TypeExpr in Lambdaexpression:
FunN<? ext rTy, ? super argTy> (x) -> g(x)
argTy der Typ von x ist und
wenn g(x): rTy oder g(x): ? ext rTy
bei g(x): ? super Ty => Fehler
bei argTyp:? super Ty => Fehler
OLD BUG