Occurs-Check bei Fun$$-Typen #279
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JavaTX/JavaCompilerCore#279
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?
Twice2.jav
class Twice2 {
TPH N id1inst;
TPH R id1;
TPH V id2inst;
TPH Z id2;
TPH AD twice;
Twice2()({
super(());
((this)::TPH Q.id1inst)::TPH N = new Id();
((this)::TPH U.id1)::TPH R = (((this)::TPH S.id1inst)::TPH N.id)::TPH T;
((this)::TPH Y.id2inst)::TPH V = new Id();
((this)::TPH AC.id2)::TPH Z = (((this)::TPH AA.id2inst)::TPH V.id)::TPH AB;
((this)::TPH AK.twice)::TPH AD = (((this)::TPH AE.id1)::TPH R.apply Signature: [TPH AG, TPH AH](((this)::TPH AF.id2)::TPH Z))::TPH AI;
})::TPH AQ
Twice2()({
super(());
})::TPH AN
}class Id {
TPH CE id;
Id()({
super(());
((this)::TPH CJ.id)::TPH CE = ((T x) -> ({
return (x)::T;
})::TPH CF)::TPH CI;
})::TPH CR
Id()({
super(());
})::TPH CN
}
Entscheidende Constraints:
R =. Fun1$$<CME,CMF>
T <. R
T =. CE
AB =. CE
AB <. Z
Z <. CME
Daraus folgt
R = T = AB = Z = CME = Fun1$$<CME,CMF>
Also müsste der Occurs-Check die Unifikation beenden. Aufgrund von Co- und Contravarianz der Argumente und die Ersetzung durch neue Typvaraiblen passiert das nicht.