Skip to content

Ast_pattern fails on attributes #633

@n-osborne

Description

@n-osborne

Inspecting a construction containing a legal attribute fails with:

Fatal error: exception Attributes not allowed here

Reproduction case:

open Ppxlib

let ___bug =
  let loc = Location.none in
  let ast = [%expr x[@bug]]
  and prop _ = true and on_error () = false
  and pat = Ast_pattern.(pexp_ident __)
  in
  Ast_pattern.parse pat loc ast ~on_error prop

let () = if ___bug then print_endline "OK" else print_endline "KO"

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