You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7682 Reporter: disteph Assigned to:@alainfrisch Status: resolved (set by @gasche on 2017-11-30T10:21:55Z) Resolution: fixed Priority: normal Severity: feature Platform: Linux Version: 4.06.0 Fixed in version: 4.07.0+dev/beta2/rc1/rc2 Category: configure and build/install Monitored by:@gasche
Bug 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.
Original bug ID: 7682
Reporter: disteph
Assigned to: @alainfrisch
Status: resolved (set by @gasche on 2017-11-30T10:21:55Z)
Resolution: fixed
Priority: normal
Severity: feature
Platform: Linux
Version: 4.06.0
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: configure and build/install
Monitored by: @gasche
Bug 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).
File attachments
The text was updated successfully, but these errors were encountered: