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

Typing of tuple patterns with -principal #5560

Closed
vicuna opened this issue Mar 27, 2012 · 2 comments
Closed

Typing of tuple patterns with -principal #5560

vicuna opened this issue Mar 27, 2012 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Mar 27, 2012

Original bug ID: 5560
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-03-28T00:45:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.00.0+dev
Category: typing

Bug description

In 4.00 or trunk with -principal:

let (a, b) = (raise Exit : int * int);;

Error: This pattern matches values of type 'a * 'b
but a pattern was expected which matches values of type int * int

This error does not happen without -principal or with OCaml 3.11.2.

@vicuna
Copy link
Author

vicuna commented Mar 27, 2012

Comment author: @alainfrisch

Same with records and sum types:

type t = {foo:int};;

type t = { foo : int; }

let {foo} = (raise Exit : t);;

Error: This pattern matches values of type t
but a pattern was expected which matches values of type t

type s = A of int;;

type s = A of int

let (A x) = (raise Exit : s);;

Error: This pattern matches values of type s
but a pattern was expected which matches values of type s

@vicuna
Copy link
Author

vicuna commented Mar 28, 2012

Comment author: @garrigue

Fixed in 4.00 and trunk, file typecore.ml, at revisions 12286 and 12287.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants