Original bug ID: 7012 Reporter:@Octachron Assigned to:@garrigue Status: closed (set by @xavierleroy on 2017-02-16T14:14:47Z) Resolution: fixed Priority: low Severity: minor Version: 4.02.3 Fixed in version: 4.03.0+dev / +beta1 Category: ~DO NOT USE (was: OCaml general) Monitored by:@gasche@hcarty
Bug description
The problem appears with
#type t = [ 'A_name | `Hi ]
Error: The type 'a is not a polymorphic variant type.
For some reasons, the type variable name 'A_name seems to be forgotten and replaced by the generic and confusing 'a.
Moreover, this happens only when the type variable name starts with a capital letter, more standard type variable names are not subject to this erasure:
type t = [ 'a_name | `Hi ] ;;
Error: The type 'a_name is not a polymorphic variant type
The text was updated successfully, but these errors were encountered:
I extended the error message with a hint as you suggest.
Note that while
type t = [ 'Foo | 'Bar ]
(or any combination with a ' and a `)
will get you the hint, just writing
type t = [ 'Foo ]
is caught as a syntax error at an earlier stage, and does not benefit from the same treatment. We're thinking about general improvements on syntax error reporting, so I won't spend time on this error specifically.
Original bug ID: 7012
Reporter: @Octachron
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:14:47Z)
Resolution: fixed
Priority: low
Severity: minor
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche @hcarty
Bug description
The problem appears with
#type t = [ 'A_name | `Hi ]
Error: The type 'a is not a polymorphic variant type.
For some reasons, the type variable name 'A_name seems to be forgotten and replaced by the generic and confusing 'a.
Moreover, this happens only when the type variable name starts with a capital letter, more standard type variable names are not subject to this erasure:
type t = [ 'a_name | `Hi ] ;;
Error: The type 'a_name is not a polymorphic variant type
The text was updated successfully, but these errors were encountered: