GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Type argument inference crashed · Issue #7683 · typetools/checker-framework

Type argument inference crashed #7683

New issue
Copy link
New issue
Copy link
Closed
#8058
Closed
Type argument inference crashed#7683
#8058
Copy link
Assignees
smillst
Labels
crash

Description

@cushon
cushon
opened on May 1, 2026
Issue body actions
import java.util.List;
import java.util.stream.Collector;

public class CrashRepro {
  static <E> Collector<E, ?, List<E>> toList() {
    throw new UnsupportedOperationException();
  }

  Object convert(Object value) {
    if (value instanceof List) {
      return ((List) value).stream().map(item -> convert(item)).collect(toList());
    }

    return value;
  }
}
$ ./checker-framework-4.0.0/checker/bin/javac -processor nullness CrashRepro.java |& head -n 30
CrashRepro.java:11: error: [return] incompatible types in return.
      return ((List) value).stream().map(item -> convert(item)).collect(toList());
                                                                       ^
  type of expression: @Initialized @Nullable Object
  method return type: @Initialized @NonNull Object
CrashRepro.java:11: error: [type.arguments.not.inferred] Could not infer type arguments for Stream.collect
      return ((List) value).stream().map(item -> convert(item)).collect(toList());
                                                                       ^
  unsatisfiable constraint: @Initialized @Nullable Object -> @Initialized @NonNull Object
  From: Constraint between method call type and target type for method call:((List)value).stream().map((item)->convert(item)).collect(toList())
CrashRepro.java:11: error: [type.argument.inference.crashed] Type argument inference crashed for CrashRepro.toList
      return ((List) value).stream().map(item -> convert(item)).collect(toList());
                                                                              ^
  error: An exception occurred: Cannot invoke "java.util.Map.keySet()" because "map" is null
Note: CrashRepro.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

Activity

  1. cushon commented on May 4, 2026

    @cushon
    cushon
    on May 4, 2026
    ContributorAuthor
    More actions

    This one appears to be somewhat uncommon in practice.

  2. smillst
    self-assigned this
    on Aug 20, 2026
  3. smillst
    added
    crash
    on Aug 20, 2026
  4. smillst
    closed this as completedin #8058on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @smillst
    smillst

Labels

crash

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.