Skip to content

Type argument inference crashed #7693

@cushon

Description

@cushon
public class CrashRepro {
  interface CheckedRunnable<X extends Throwable> {
    void run() throws X;
  }

  <X extends Throwable> void call(CheckedRunnable<X> runnable) throws X {}

  void test() throws Exception {
    call(
        () -> {
          try {
            System.out.println();
          } catch (RuntimeException e) {
          }
        });
  }
}
$ ~/checker-framework-4.0.0/checker/bin/javac -processor nullness CrashRepro.java
CrashRepro.java:9: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.call
    call(
        ^
  error: An exception occurred: Cannot invoke "java.util.Collection.getClass()" because "c" is null
CrashRepro.java:9: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.call
    call(
        ^
  error: An exception occurred: Cannot invoke "java.util.Collection.getClass()" because "c" is null
2 errors

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