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

Strings incorrectly type-checked in tuple context #6414

Closed
vicuna opened this issue May 12, 2014 · 3 comments
Closed

Strings incorrectly type-checked in tuple context #6414

vicuna opened this issue May 12, 2014 · 3 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented May 12, 2014

Original bug ID: 6414
Reporter: @yallop
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:27:01Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.02.0+dev
Category: typing
Tags: patch

Bug description

In trunk:

if true then 1, 2 else "";;

Fatal error: exception Ctype.Unify(_)

File attachments

@vicuna
Copy link
Author

vicuna commented May 12, 2014

Comment author: @yallop

It looks like the problem comes from the attempt to match strings against format tuples, which doesn't catch unification errors. I've attached a patch which fixes the immediate problem when applied, but I'm not sure that it's the right solution.

@vicuna
Copy link
Author

vicuna commented May 13, 2014

Comment author: @gasche

This part of the GADT patch is a bit hacky, and not there to stay anyway: the right solution is to use a nominal type for formats (it will also avoid printed error messages to print both the type and its definition); it is planned, but I didn't have time to do it properly before the merge.

@vicuna
Copy link
Author

vicuna commented May 14, 2014

Comment author: @gasche

Fixed in trunk@14868 and 4.02@14866.

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