Skip to content

Type argument inference crashed #7682

Description

@cushon
public class CrashRepro<T> {
  interface FailureRunnable<X extends Throwable> {
    void onFailure() throws X;
  }

  static <T> T doThrow() {
    throw new IllegalStateException();
  }

  <X extends Throwable> void run(FailureRunnable<X> onFailure) throws X {}

  <X extends Throwable> void run() throws X {
    run(CrashRepro::doThrow);
  }
}
$ ./checker-framework-4.0.0/checker/bin/javac -processor nullness CrashRepro.java |& head -n 30
CrashRepro.java:13: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.run
    run(CrashRepro::doThrow);
       ^
  error: An exception occurred: Cannot invoke "org.checkerframework.framework.util.typeinference8.types.AbstractType.getTypeKind()" because "r" is null
CrashRepro.java:13: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.run
    run(CrashRepro::doThrow);
       ^
  error: An exception occurred: Cannot invoke "org.checkerframework.framework.util.typeinference8.types.AbstractType.getTypeKind()" because "r" is null
2 errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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