本文整理了Java中com.sun.tools.javac.code.Types.lub()
方法的一些代码示例,展示了Types.lub()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.lub()
方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:lub
[英]Return the least upper bound of pair of types. if the lub does not exist return null.
[中]返回一对类型的最小上界。如果润滑油不存在,则返回null。
代码示例来源:origin: google/error-prone
result.add(inliner.types().lub(List.from(exprTys)));
代码示例来源:origin: google/error-prone
ty = trueTy;
} else {
ty = Types.instance(unifier.getContext()).lub(trueTy, falseTy);
代码示例来源:origin: google/error-prone
Type lub = state.getTypes().lub(argumentType, receiverType);
代码示例来源:origin: sc.fiji/javac
/**
* Return the least upper bound of pair of types. if the lub does
* not exist return null.
*/
public Type lub(Type t1, Type t2) {
return lub(List.of(t1, t2));
}
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
/**
* Return the least upper bound of pair of types. if the lub does
* not exist return null.
*/
public Type lub(Type t1, Type t2) {
return lub(List.of(t1, t2));
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
/**
* Return the least upper bound of pair of types. if the lub does
* not exist return null.
*/
public Type lub(Type t1, Type t2) {
return lub(List.of(t1, t2));
}
代码示例来源:origin: konsoletyper/teavm-javac
/**
* Return the least upper bound of list of types. if the lub does
* not exist return null.
*/
public Type lub(List<Type> ts) {
return lub(ts.toArray(new Type[ts.length()]));
}
代码示例来源:origin: com.google.errorprone/error_prone_core
result.add(inliner.types().lub(List.from(exprTys)));
代码示例来源:origin: konsoletyper/teavm-javac
private Pair<Type, Type> getParameterizedSupers(Type t, Type s) {
Type lubResult = types.lub(t, s);
if (lubResult == syms.errType || lubResult == syms.botType ||
!lubResult.isParameterized()) {
return null;
}
Type asSuperOfT = types.asSuper(t, lubResult.tsym);
Type asSuperOfS = types.asSuper(s, lubResult.tsym);
return new Pair<>(asSuperOfT, asSuperOfS);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
@Override
Type solve(UndetVar uv, InferenceContext inferenceContext) {
Infer infer = inferenceContext.infer();
List<Type> lobounds = filterBounds(uv, inferenceContext);
//note: lobounds should have at least one element
Type owntype = lobounds.tail.tail == null ? lobounds.head : infer.types.lub(lobounds);
if (owntype.isPrimitive() || owntype.hasTag(ERROR)) {
throw infer.inferenceException
.setMessage("no.unique.minimal.instance.exists",
uv.qtype, lobounds);
} else {
return owntype;
}
}
},
代码示例来源:origin: konsoletyper/teavm-javac
@Override
Type solve(UndetVar uv, InferenceContext inferenceContext) {
Infer infer = inferenceContext.infer();
List<Type> lobounds = filterBounds(uv, inferenceContext);
//note: lobounds should have at least one element
Type owntype = lobounds.tail.tail == null ? lobounds.head : infer.types.lub(lobounds);
if (owntype.isPrimitive() || owntype.hasTag(ERROR)) {
throw infer.inferenceException
.setMessage("no.unique.minimal.instance.exists",
uv.qtype, lobounds);
} else {
return owntype;
}
}
},
代码示例来源:origin: com.google.errorprone/error_prone_core
ty = trueTy;
} else {
ty = Types.instance(unifier.getContext()).lub(trueTy, falseTy);
代码示例来源:origin: sc.fiji/javac
that.inst = that.lobounds.head;
else {
that.inst = types.lub(that.lobounds);
if (that.inst == null)
throw ambiguousNoInstanceException
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
that.inst = that.lobounds.head;
else {
that.inst = types.lub(that.lobounds);
if (that.inst == null)
throw ambiguousNoInstanceException
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
Type m;
if (mergeCache.add(pair)) {
m = new WildcardType(lub(upperBound(act1.head),
upperBound(act2.head)),
BoundKind.EXTENDS,
代码示例来源:origin: sc.fiji/javac
Type m;
if (mergeCache.add(pair)) {
m = new WildcardType(lub(upperBound(act1.head),
upperBound(act2.head)),
BoundKind.EXTENDS,
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
Type m;
if (mergeCache.add(pair)) {
m = new WildcardType(lub(upperBound(act1.head),
upperBound(act2.head)),
BoundKind.EXTENDS,
代码示例来源:origin: konsoletyper/teavm-javac
Type m;
if (mergeCache.add(pair)) {
m = new WildcardType(lub(wildUpperBound(act1.head),
wildUpperBound(act2.head)),
BoundKind.EXTENDS,
代码示例来源:origin: com.google.errorprone/error_prone_core
Type lub = state.getTypes().lub(argumentType, receiverType);
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
Type t = check(tree, types.lub(multicatchTypes.toList()), TYP, resultInfo);
if (t.hasTag(CLASS)) {
List<Type> alternatives =
内容来源于网络,如有侵权,请联系作者删除!