Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini-bug parser #3146

Closed
vicuna opened this issue Jan 11, 2002 · 1 comment
Closed

Mini-bug parser #3146

vicuna opened this issue Jan 11, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 11, 2002

Original bug ID: 801
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Salut,

le parser refuse ça:
type t = [ `A of int ]
type s = [ t ]

alors qu'il accepte ça:
type t = [ `A of int ]
type s = [ | t ]

(dans le premier cas, il s'attend à un tag_field, alors que c'est
un simple_core_type2; je n'ai pas testé, mais mettre row_field
à la place de tag_field dans LBRACKET tag_field RBRACKET,
ça devrait faire l'affaire).

--
Alain

@vicuna
Copy link
Author

vicuna commented Jan 12, 2002

Comment author: administrator

From: frisch@clipper.ens.fr

le parser refuse ça:
type t = [ `A of int ]
type s = [ t ]

alors qu'il accepte ça:
type t = [ `A of int ]
type s = [ | t ]

(dans le premier cas, il s'attend à un tag_field, alors que c'est
un simple_core_type2; je n'ai pas testé, mais mettre row_field
à la place de tag_field dans LBRACKET tag_field RBRACKET,
ça devrait faire l'affaire).

Ce n'est pas un bug. Accepter le premier cas causerait une ambiguite'
dans les types de classes (le [ y est utilise' pour indiquer les
parametres d'un type de classe par opposition a` un type normal).

On pourrait eventuellement refuser le deuxieme cas aussi, comme
inutile (tout ca est equivalent a` type s = t), mais ca ne m'a pas
paru justifier une complication supplementaire dans le parser.

Jacques

@vicuna vicuna closed this as completed Feb 11, 2002
@vicuna vicuna added the bug label Mar 19, 2019
ulrikstrid pushed a commit to ulrikstrid/ocaml that referenced this issue Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant