Skip to content

Windows: a user fn named like a platform API (accept) resolves to the extern #806

Closed

Description

@ropoctl

Restated (2026-10-25 triage)

Windows: a user function named like a platform API (accept, the Winsock extern) resolves to the extern instead of the user's declaration, so spec_ss03_9_implicit_trait_object_coercion fails to build ("manual extern function call requires unsafe context"). §18.1: the visible user declaration wins. The other nine spec tests this issue named pass on Windows.


Original report

On native Windows x86_64 (self-host green battery, build :test → native-spec-tests), the following test/spec/*.w tests fail with exit code 1 (wrong output — not a crash). All pass on linux x86_64 and macOS arm64; they are Windows-only regressions in codegen for the associated language features.

Failing tests:

  • spec_ss03_9_box_dyn_coercion.w — Box[dyn] trait-object coercion
  • spec_ss03_9_implicit_trait_object_coercion.w — implicit trait-object coercion
  • spec_ss10_3_option_result_combinators.w — Option/Result combinators (closures)
  • spec_ss10_5_sequence_traverse_transpose.w — sequence/traverse/transpose
  • spec_ss10_6_error_context.w — error context
  • spec_ss10_6_result_combinators_complete.w — Result combinators (complete)
  • spec_ss10_8_error_trait.w — Error trait (dyn)
  • spec_ss11_3_object_safety.w — object safety / dyn dispatch
  • spec_ss13_3_collect_targets.w — collect targets (iterator)
  • spec_ss14_3_1_no_suspend_blocks.w — async blocks that never suspend

These are gated with //! skip-windows: (referencing this issue) so the Windows green battery passes; the gates are removed incrementally as each underlying codegen gap is root-caused and fixed. Likely clusters: win64 trait-object/vtable ABI (box_dyn / trait_object / object_safety / error_trait), win64 fat-fn / closure ABI in combinators (option_result / result_complete / sequence_traverse / error_context / collect), and async lowering (no_suspend_blocks). Each needs root-cause to the exact codegen site before its skip is lifted.

Activity

  1. 36 remaining items

  2. changed the title [-]Windows: spec suite tests fail (exit 1) — trait-object/combinator/error/async codegen[/-] [+]Windows: a user fn named like a platform API (accept) resolves to the extern[/+] on Oct 25, 2026
  3. ehartford commented on Oct 25, 2026

    @ehartford
    Contributor

    Triage 2026-10-25, Windows x86_64 (win10, with.exe built from main c88f3ee): 9 of the 10 spec tests now pass on Windows. One still fails, for a reason the issue did not see: a user function named accept resolves to the Windows socket extern instead of the user's own declaration.

    test/spec/spec_ss03_9_implicit_trait_object_coercion.w
    11 | fn accept(g: &dyn Greet) -> str:
    
    error: manual extern function call requires unsafe context
     --> test/spec/spec_ss03_9_implicit_trait_object_coercion.w:16:12
    16 |     assert(accept(&eng) == "Hello")
    

    It passes on macOS. This is #750's class on Windows: a platform name outranks the user's visible declaration (§18.1). pre-release: any program with a function named like a Windows API name (accept, send, connect, select, …) fails to build on Windows only.

  4. ehartford commented on Oct 26, 2026

    @ehartford
    Contributor

    Fixed on main by 2c4c882 (#2720), merged through stack 8 whose seed-driven battery was green on its top (gate, uat and survey all green). Regression test: test/behavior/behav_806_user_fn_named_like_platform_extern.w.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions