Skip to content

ICE: user-generic call lacks a concrete contract for method-form collect (m.keys().collect[List]()) #2383

Closed

Description

@ehartford

On main (installed compiler e10eff9):

use std.collections.HashMap
fn main:
    var m: HashMap[str, i32] = HashMap.new()
    m.insert("a", 1)
    let ks: List[str] = m.keys().collect[List]()
    print(ks.len())

Actual: BUG: user generic call lacks a concrete contract: body=1007(main) call=3 node=10984 sig=-1 mono=0 [src/MirLower.w:18487 MirModule.validate_generic_call_contracts], exit 134. The pipeline spelling (m.keys() |> collect[List]()) takes the adapter path in SemaCheck's pipeline typing and does not ICE (it then hits the #2271 demand issues). Method-form collect on a user Iter implementor reaches MIR without a resolved generic-call record. Found during #2271 investigation.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce.

    $ cat main.w
    use std.collections.HashMap
    fn main:
        var m: HashMap[str, i32] = HashMap.new()
        m.insert("a", 1)
        let ks: List[str] = m.keys().collect[List]()
        print(ks.len())
    $ with run main.w
    1
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions