You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6374 Reporter:@alainfrisch Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2015-12-11T18:29:28Z) Resolution: fixed Priority: normal Severity: feature Fixed in version: 4.02.0 Category: typing Tags: patch Related to:#5528 Monitored by:@jmeber@yallop@hcarty@yakobowski
Bug description
I propose to accept the type expression "_ t" when "t" is a type constructor with more than one argument. This makes it easier, for instance, to write:
("%s" : _ format)
and this is very coherent with the behavior of patterns on n-ary constructors.
I attach a trivial patch.
A further motivation is for the work on inlined records (#5528): the implicit inner record types are given type variables derived from the free variables in the record definition. It's better if one can add a type annotation on those t.A record types without having to care about their exact arity.
I'll commit this patch in a few days unless someone objects to it.
I understand your point, and there is a good argument that it matches the use of wildcards in pattern matching.
However, this is an important change, and I think it should be discussed on the developer's list.
This was committed by mistake in commit 14659 (which means it went out in 4.02, sorry!). Since then, this was discussed on caml-devel, there was some positive feedback and no opposition, and so I'll leave it there.
Original bug ID: 6374
Reporter: @alainfrisch
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:29:28Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.02.0
Category: typing
Tags: patch
Related to: #5528
Monitored by: @jmeber @yallop @hcarty @yakobowski
Bug description
I propose to accept the type expression "_ t" when "t" is a type constructor with more than one argument. This makes it easier, for instance, to write:
("%s" : _ format)
and this is very coherent with the behavior of patterns on n-ary constructors.
I attach a trivial patch.
A further motivation is for the work on inlined records (#5528): the implicit inner record types are given type variables derived from the free variables in the record definition. It's better if one can add a type annotation on those t.A record types without having to care about their exact arity.
I'll commit this patch in a few days unless someone objects to it.
File attachments
The text was updated successfully, but these errors were encountered: