Skip to content

use and import in a class or record definition results in a syntax error #26484

Open
@e-kayrakli

Description

@e-kayrakli

We can use or import modules in function scope. Trying to do that in a class or record scope, I am getting a syntax error. I think we should be able to do that but that's not a strong preference for me, at all. However, emitting a syntax error for attempting to do so feels wrong and we should provide a more helpful error message.

record R {
  use IO;
}

You can swap record with class, and use with import. The behavior is the same.

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