< prev index next >
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
Print this page
*** 26,36 ****
package com.sun.tools.javac.comp;
import com.sun.tools.javac.code.Source.Feature;
import com.sun.tools.javac.code.Type.UndetVar.UndetVarListener;
import com.sun.tools.javac.code.Types.TypeMapping;
- import com.sun.tools.javac.comp.Attr.CheckMode;
import com.sun.tools.javac.resources.CompilerProperties.Fragments;
import com.sun.tools.javac.resources.CompilerProperties.Notes;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCTypeCast;
import com.sun.tools.javac.tree.TreeInfo;
--- 26,35 ----
*** 277,287 ****
return List.of(mt.getReturnType());
}
}
/**
! * A partially infered method/constructor type; such a type can be checked multiple times
* against different targets.
*/
public class PartiallyInferredMethodType extends MethodType {
public PartiallyInferredMethodType(MethodType mtype, InferenceContext inferenceContext, Env<AttrContext> env, Warner warn) {
super(mtype.getParameterTypes(), mtype.getReturnType(), mtype.getThrownTypes(), mtype.tsym);
--- 276,286 ----
return List.of(mt.getReturnType());
}
}
/**
! * A partially inferred method/constructor type; such a type can be checked multiple times
* against different targets.
*/
public class PartiallyInferredMethodType extends MethodType {
public PartiallyInferredMethodType(MethodType mtype, InferenceContext inferenceContext, Env<AttrContext> env, Warner warn) {
super(mtype.getParameterTypes(), mtype.getReturnType(), mtype.getThrownTypes(), mtype.tsym);
*** 304,314 ****
return true;
}
/**
* Checks this type against a target; this means generating return type constraints, solve
! * and then roll back the results (to avoid poolluting the context).
*/
Type check(Attr.ResultInfo resultInfo) {
Warner noWarnings = new Warner(null);
List<Type> saved_undet = null;
try {
--- 303,313 ----
return true;
}
/**
* Checks this type against a target; this means generating return type constraints, solve
! * and then roll back the results (to avoid polluting the context).
*/
Type check(Attr.ResultInfo resultInfo) {
Warner noWarnings = new Warner(null);
List<Type> saved_undet = null;
try {
*** 1619,1632 ****
/** bound dependency */
BOUND("dotted"),
/** stuck dependency */
STUCK("dashed");
! final String dotSyle;
! private DependencyKind(String dotSyle) {
! this.dotSyle = dotSyle;
}
}
/**
* This is the graph inference solver - the solver organizes all inference variables in
--- 1618,1631 ----
/** bound dependency */
BOUND("dotted"),
/** stuck dependency */
STUCK("dashed");
! final String dotStyle;
! private DependencyKind(String dotStyle) {
! this.dotStyle = dotStyle;
}
}
/**
* This is the graph inference solver - the solver organizes all inference variables in
*** 1827,1837 ****
}
@Override
public Properties dependencyAttributes(Node sink, GraphUtils.DependencyKind dk) {
Properties p = new Properties();
! p.put("style", ((DependencyKind)dk).dotSyle);
StringBuilder buf = new StringBuilder();
String sep = "";
for (Type from : data) {
UndetVar uv = (UndetVar)inferenceContext.asUndetVar(from);
for (Type bound : uv.getBounds(InferenceBound.values())) {
--- 1826,1836 ----
}
@Override
public Properties dependencyAttributes(Node sink, GraphUtils.DependencyKind dk) {
Properties p = new Properties();
! p.put("style", ((DependencyKind)dk).dotStyle);
StringBuilder buf = new StringBuilder();
String sep = "";
for (Type from : data) {
UndetVar uv = (UndetVar)inferenceContext.asUndetVar(from);
for (Type bound : uv.getBounds(InferenceBound.values())) {
< prev index next >