Skip to content

Grouped imports give cryptic 'expected identifier' instead of explaining the syntax #4

Closed

Description

@ehartford

Current behavior

use crux.core.{shape2, shape3, strides_get}
error: expected identifier
 --> test/view_smoke.w:1:18
1 | use crux.core.{shape2, shape3, strides_get}
  |                  ^

The caret points at shape2 inside the braces. There is no indication that brace-grouped imports are the problem. An agent (or human) will try renaming shape2, quoting it, changing the path — everything except the actual fix.

Expected behavior

error: grouped imports are not supported
 --> test/view_smoke.w:1:16
1 | use crux.core.{shape2, shape3, strides_get}
  |                ^
  = help: import the entire module instead: `use crux.core`

Repro

mkdir -p /tmp/wbug/lib/demo
echo "pub fn add(a: i32, b: i32) -> i32: a + b" > /tmp/wbug/lib/demo/math.w
echo 'use demo.math.{add}
fn main: let x = add(1, 2)' > /tmp/wbug/main.w
cd /tmp/wbug && with check main.w

Activity

  1. added
    error-messages
    on Mar 20, 2026
  2. ehartford commented on Mar 20, 2026

    @ehartford
    ContributorAuthor

    Verified on current main: grouped imports now parse and run successfully. The original use demo.math.{add} style repro imports and executes cleanly, so this issue is stale.

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

    error-messages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions