Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
jdk: [ 8, 11 ]
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions src/ontology/OntologyInferenceAnnotatedTypeFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
import ontology.qual.OntologyValue;
import ontology.util.OntologyUtils;
import org.checkerframework.common.basetype.BaseAnnotatedTypeFactory;
import org.checkerframework.framework.qual.TypeUseLocation;
import org.checkerframework.framework.type.AnnotatedTypeFactory;
import org.checkerframework.framework.type.AnnotatedTypeMirror;
import org.checkerframework.framework.type.QualifierHierarchy;
import org.checkerframework.framework.type.treeannotator.ListTreeAnnotator;
import org.checkerframework.framework.type.treeannotator.LiteralTreeAnnotator;
import org.checkerframework.framework.type.treeannotator.TreeAnnotator;
import org.checkerframework.framework.util.MultiGraphQualifierHierarchy.MultiGraphFactory;
import org.checkerframework.framework.util.defaults.QualifierDefaults;

public class OntologyInferenceAnnotatedTypeFactory extends InferenceAnnotatedTypeFactory {

Expand Down Expand Up @@ -93,6 +95,17 @@ protected void finish(
}
}

/**
* TODO: Temporarily set the same default as in OntologyInferenceAnnotatedTypeFactory. Such a
Comment thread
d367wang marked this conversation as resolved.
Outdated
* default should not be necessary in inference, but works around this CFI issue:
* https://github.com/opprop/checker-framework-inference/issues/310
*/
@Override
protected void addCheckedCodeDefaults(QualifierDefaults defaults) {
TypeUseLocation[] topLocations = {TypeUseLocation.ALL};
defaults.addCheckedCodeDefaults(OntologyUtils.ONTOLOGY_TOP, topLocations);
}

@Override
public TreeAnnotator createTreeAnnotator() {
return new ListTreeAnnotator(
Expand Down
17 changes: 17 additions & 0 deletions testing/ParameterizedTypeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
interface Iterator<T> {
T next();
}

abstract class CursorIterator implements Iterator<Double> {
}

abstract class Matrix {
public void multiply1(CursorIterator it) {
double x = it.next();
}

public void multiply2(CursorIterator it) {
double x;
x = it.next();
}
}