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

Inline records error messages could be improved #7190

Closed
vicuna opened this Issue Mar 21, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

commented Mar 21, 2016

Original bug ID: 7190
Reporter: @johnwhitington
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-09-24T15:32:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)

Bug description

(OCaml 4.03 beta 1)

Consider the following user mistake:

type t = Foo of {x : int; y : int};;

type t = Foo of { x : int; y : int; }

Foo (1, 2);;

Error: This form is not allowed as the type of the inlined record could escape.

Would it be possible to improve this to say that (1, 2) has type "int * int" but t.Foo has type "{x : int; y : int}"? The current message doesn't give any hint to help the user fix the mistake.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 21, 2016

Comment author: @gasche

I'm setting the target as 4.03, as indeed the errors are fairly bad right now.

Foo [1; 2];;

Error: This form is not allowed as the type of the inlined record could escape.

Foo 1;;

Error: This form is not allowed as the type of the inlined record could escape.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 21, 2016

Comment author: @alainfrisch

#521

@vicuna vicuna closed this Sep 24, 2017

@vicuna vicuna added this to the 4.03.0 milestone 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.