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

Comments

Projects
None yet
2 participants
@vicuna
Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented Mar 28, 2012

Comment author: @garrigue

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

@vicuna vicuna closed this Mar 28, 2012

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.