Anonymous | Login | Signup for a new account | 2019-02-21 18:40 CET | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0007682 | OCaml | configure and build/install | public | 2017-11-29 00:21 | 2017-12-05 18:37 | |||||||
Reporter | disteph | |||||||||||
Assigned To | frisch | |||||||||||
Priority | normal | Severity | feature | Reproducibility | always | |||||||
Status | resolved | Resolution | fixed | |||||||||
Platform | Linux | OS | OS Version | |||||||||
Product Version | 4.06.0 | |||||||||||
Target Version | Fixed in Version | 4.07.0+dev/beta2/rc1/rc2 | ||||||||||
Summary | 0007682: [@@unboxed] for records with 1 polymorphic field | |||||||||||
Description | The following three lines lead to a compile-time crash type f = {field: 'a. 'a list} [@@unboxed] let g = Array.make 10 { field=[] } let h = g.(5) The error is Fatal error: exception File "typing/typeopt.ml", line 98, characters 6-12: Assertion failed | |||||||||||
Steps To Reproduce | ocamlc bug.ml where bug is the attached file. | |||||||||||
Additional Information | I was surprised by the nature of the error. Merlin didn't complain about typing, and the "exception File "typing/typeopt.ml", line 98, characters 6-12: Assertion failed" is not where I would have expected a problem to arise. If it is a known limitation of unboxing that doesn't marry well with polymorphism in the field type, I would have expected the error to tell me so, while an "Assertion failed" sounds more like a missed case. It'd be amazing if it did work by just removing the assertion, though. But life is probably not that beautiful. Reproducible in 4.05.0 (at least). | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ![]() | |||||||||||
![]() |
|
(0018708) disteph (reporter) 2017-11-29 00:24 |
Also, it's surprising that the first two lines alone compile perfectly well type f = {field: 'a. 'a list} [@@unboxed] let g = Array.make 10 { field=[] } It's really when I access an array cell that the compilation crashes. |
(0018709) frisch (developer) 2017-11-29 09:35 |
I believe Ctype.get_unboxed_type_representation should traverse Tpoly. Working on a fix. |
(0018712) frisch (developer) 2017-11-29 10:06 |
https://github.com/ocaml/ocaml/pull/1495 [^] |
(0018727) gasche (administrator) 2017-11-30 11:21 |
The issue was fixed by merging Alain Frisch's patch. Thanks for the testing and report! |
(0018732) disteph (reporter) 2017-12-05 18:37 |
Thank you both for your very prompt response! |
![]() |
|||
Date Modified | Username | Field | Change |
2017-11-29 00:21 | disteph | New Issue | |
2017-11-29 00:21 | disteph | File Added: bug.ml | |
2017-11-29 00:24 | disteph | Note Added: 0018708 | |
2017-11-29 09:35 | frisch | Note Added: 0018709 | |
2017-11-29 10:06 | frisch | Note Added: 0018712 | |
2017-11-30 11:21 | gasche | Note Added: 0018727 | |
2017-11-30 11:21 | gasche | Status | new => resolved |
2017-11-30 11:21 | gasche | Fixed in Version | => 4.07.0+dev/beta2/rc1/rc2 |
2017-11-30 11:21 | gasche | Resolution | open => fixed |
2017-11-30 11:21 | gasche | Assigned To | => frisch |
2017-12-05 18:37 | disteph | Note Added: 0018732 |
Copyright © 2000 - 2011 MantisBT Group |