Wildcards in FUNN$$ einfuegen #55

Open
opened 2019-10-24 11:57:49 +00:00 by pl · 0 comments
Owner

Wenn ein Typ FUN1$$<Integer,Integer> inferiert könnte die Typinformation im Class-File FUN1$$<? super Integer,? extends Integer> sein.

Beispiel

mathStruc.class

javap mathStruc.class
Compiled from "mathStruc.jav"
public class mathStruc<K$ extends EYS$, EYL$ extends AB$, AB$ extends K$, EYS$> {
K$ model;
Fun1$$<Fun2$<EYS, EYS$, EYL$>, Fun1$$<mathStruc, mathStruc>> innerOp;
public mathStruc(AB$);
}

und

javap MatrixOP.class
Compiled from "MatrixOP.jav"
public class MatrixOP extends java.util.Vector<java.util.Vector<java.lang.Integer>> {
public Fun2$$<java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, MatrixOP> mul;
public MatrixOP();
public MatrixOP(java.util.Vector<java.util.Vector<java.lang.Integer>>);
}

Um mul aus MatrixOP anwenden zu können muss man als 4. Argument
Vector<? extends Vector<? extends Integer>>> statt MatrixOP einsetzen:

mathStruc<MatrixOP, MatrixOP, MatrixOP,
!!Vector<? extends Vector<? extends Integer>>!!> mms
= new mathStruc<>(m1);
mathStruc<MatrixOP, MatrixOP, MatrixOP,
!!Vector<? extends Vector<? extends Integer>>!!> mms2
= new mathStruc<>(m2);
mathStruc<MatrixOP, MatrixOP, MatrixOP, MatrixOP> mms3
= mms.innerOp.apply(m1.mul).apply(mms2);
System.out.println(mms3.model);

Ziel wäre:

mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms
= new mathStruc<>(m1);
mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms2
= new mathStruc<>(m2);

Wenn ein Typ FUN1$$<Integer,Integer> inferiert könnte die Typinformation im Class-File FUN1$$<? super Integer,? extends Integer> sein. Beispiel mathStruc.class javap mathStruc.class Compiled from "mathStruc.jav" public class mathStruc<K$ extends EYS$, EYL$ extends AB$, AB$ extends K$, EYS$> { K$ model; Fun1$$<Fun2$$<EYS$, EYS$, EYL$>, Fun1$$<mathStruc, mathStruc>> innerOp; public mathStruc(AB$); } und javap MatrixOP.class Compiled from "MatrixOP.jav" public class MatrixOP extends java.util.Vector<java.util.Vector<java.lang.Integer>> { public Fun2$$<java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, MatrixOP> mul; public MatrixOP(); public MatrixOP(java.util.Vector<java.util.Vector<java.lang.Integer>>); } Um mul aus MatrixOP anwenden zu können muss man als 4. Argument Vector<? extends Vector<? extends Integer>>> statt MatrixOP einsetzen: mathStruc<MatrixOP, MatrixOP, MatrixOP, !!Vector<? extends Vector<? extends Integer>>!!> mms = new mathStruc<>(m1); mathStruc<MatrixOP, MatrixOP, MatrixOP, !!Vector<? extends Vector<? extends Integer>>!!> mms2 = new mathStruc<>(m2); mathStruc<MatrixOP, MatrixOP, MatrixOP, MatrixOP> mms3 = mms.innerOp.apply(m1.mul).apply(mms2); System.out.println(mms3.model); Ziel wäre: mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms = new mathStruc<>(m1); mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms2 = new mathStruc<>(m2);
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JavaTX/JavaCompilerCore#55
No description provided.