Skip to content

Sema: "internal error: conflicting contextual join decisions for one expression" in std/collections/sorted_vec.w when the importing program also imports from std.libc #2000

Closed

Description

@ehartford

Found implementing #1998 (branch wave-build).

Repro: test/complexity/stdlib.w as on main (ac522dc) plus one line, use std.libc.libc_stdin (any std.libc item; use std.libc.cpu_time_ns on wave-build too), after use std.time. Then with check on it:

error: internal error: conflicting contextual join decisions for one expression
 --> <embedded-std>/std/collections/sorted_vec.w:72:9
72 |         if found < 0: None else: Some(found as i32)
error: missing return
 --> <embedded-std>/std/collections/sorted_vec.w:67:9

Reproduced with the installed with v0.15.3.0 and with the release compiler of ac522dc + wave-build, so it predates both. The file without the import checks ok.

Not sufficient on its own: a minimal program with the same import and a SortedVec[i32] insert/len checks ok, so something else the harness instantiates is part of the trigger; not yet reduced (with reduce over the harness with --contains "conflicting contextual join" is the next step).

Expected: importing an unrelated std module never changes how another std module's body types (§18.1; D70); and an internal error is never a user-facing outcome.

Workaround used: test/complexity/stdlib.w declares the with_libc_cpu_time_ns seam itself instead of use std.libc.cpu_time_ns (#1998); the fix removes it.

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