Skip to content

Compiler prevents adding attributes in front of { #7814

Open

Description

@benadamstyles

The compiler (v11) does not support @s.strict in the following structure:

@schema
type t = @s.strict {
  email: string,
  name: string,
}

This is expected to work at least by some library developers, see original bug report: DZakh/sury#151

Activity

  1. cristianoc commented on Aug 28, 2025

    @cristianoc
    Collaborator

    This is exactly what discussed missing in the PR to support adding an attribute without "|" in a variant type declaration.
    A follow-on PR would address this. Well at least the parse error.
    CC @zth

  2. shulhi commented on Dec 26, 2025

    @shulhi
    Member

    I'm not sure if I agree with allowing attribute there. While technically it is possible, but I think we should strive for consistency.

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