Skip to content

Investigate Index Checker with lambdas and varargs #1697

@wmdietl

Description

@wmdietl

This should be investigated separately. Example errors:

./checker/bin/javac -processor index framework/tests/all-systems/VarargsLambda.java
framework/tests/all-systems/VarargsLambda.java:81: error: [return.type.incompatible] incompatible types in return.
        applyAll("seed", s -> s + "a", s -> s + "b", s -> s + "c");
                                ^
  type of expression: @StringVal({"nulla", "seeda"}) String
  method return type: @StringVal("seed") String
framework/tests/all-systems/VarargsLambda.java:81: error: [return.type.incompatible] incompatible types in return.
        applyAll("seed", s -> s + "a", s -> s + "b", s -> s + "c");
                                              ^
  type of expression: @StringVal({"nullb", "seedb"}) String
  method return type: @StringVal("seed") String
framework/tests/all-systems/VarargsLambda.java:81: error: [return.type.incompatible] incompatible types in return.
        applyAll("seed", s -> s + "a", s -> s + "b", s -> s + "c");
                                                            ^
  type of expression: @StringVal({"nullc", "seedc"}) String
  method return type: @StringVal("seed") String
framework/tests/all-systems/VarargsLambda.java:96: error: [type.invalid.annotations.on.location] annotation @org.checkerframework.checker.index.qual.UpperBoundLiteral(42) used on prohibited locations PARAMETER
        forEach(42, n -> {}, n -> {}, n -> {});
                    ^
framework/tests/all-systems/VarargsLambda.java:96: error: [type.invalid.annotations.on.location] annotation @org.checkerframework.checker.index.qual.UpperBoundLiteral(42) used on prohibited locations PARAMETER
        forEach(42, n -> {}, n -> {}, n -> {});
                             ^
framework/tests/all-systems/VarargsLambda.java:96: error: [type.invalid.annotations.on.location] annotation @org.checkerframework.checker.index.qual.UpperBoundLiteral(42) used on prohibited locations PARAMETER
        forEach(42, n -> {}, n -> {}, n -> {});
                                      ^
6 errors

Originally posted by @wmdietl in #1696

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions