We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Original bug ID: 5948 Reporter: @lpw25 Assigned to: @garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:18:41Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.1 Fixed in version: 4.00.2+dev Category: typing Child of: #5998 Monitored by: @gasche
I came across a typing bug while playing around with GADTs and polymorphic variants. The following code produces a segmentation fault:
type tag = [TagA | TagB | `TagC]
TagA |
type 'a poly = AandBTags : [< TagA of int | TagB ] poly | ATag : [< TagA of int] poly constraint 'a = [< TagA of int | `TagB]
TagA of int |
TagA of int] poly constraint 'a = [<
let intA = function TagA i -> i let intB = function TagB -> 4
TagA i -> i let intB = function
let intAorB = function TagA i -> i | TagB -> 4
TagA i -> i |
type _ wrapPoly = WrapPoly : 'a poly -> ([< TagA of int | TagB] as 'a) wrapPoly
let example6 : type a. a wrapPoly -> (a -> int) = fun w -> match w with | WrapPoly ATag -> intA | WrapPoly _ -> intA (* This should not be allowed *)
let _ = example6 (WrapPoly AandBTags) `TagB (* This causes a seg fault *)
The text was updated successfully, but these errors were encountered:
Comment author: @garrigue
Fixed in trunk and 4.00, revisions 13396 and 13397.
Note: you cannot refine variant types whose row variable is rigid.
Sorry, something went wrong.
garrigue
No branches or pull requests
Original bug ID: 5948
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:41Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: typing
Child of: #5998
Monitored by: @gasche
Bug description
I came across a typing bug while playing around with GADTs and polymorphic variants. The following code produces a segmentation fault:
type tag = [
TagA |
TagB | `TagC]type 'a poly =
AandBTags : [<
TagA of int |
TagB ] poly| ATag : [<
TagA of int] poly constraint 'a = [<
TagA of int | `TagB]let intA = function
TagA i -> i let intB = function
TagB -> 4let intAorB = function
TagA i -> i |
TagB -> 4type _ wrapPoly =
WrapPoly : 'a poly -> ([<
TagA of int |
TagB] as 'a) wrapPolylet example6 : type a. a wrapPoly -> (a -> int) =
fun w ->
match w with
| WrapPoly ATag -> intA
| WrapPoly _ -> intA (* This should not be allowed *)
let _ = example6 (WrapPoly AandBTags) `TagB (* This causes a seg fault *)
The text was updated successfully, but these errors were encountered: