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

Interaction between [@@unboxed] and primitives #7828

Closed
vicuna opened this issue Jul 20, 2018 · 1 comment
Closed

Interaction between [@@unboxed] and primitives #7828

vicuna opened this issue Jul 20, 2018 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Jul 20, 2018

Original bug ID: 7828
Reporter: @trefis
Assigned to: @gasche
Status: resolved (set by @gasche on 2018-09-03T09:26:18Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.1
Fixed in version: 4.08.0+dev/beta1/beta2
Category: typing
Monitored by: @gasche @diml

Bug description

Noticed on 4.06 by Stefan Muenzel, reproduced on trunk.

    OCaml version 4.06.1

type t = I of int [@@unboxed] [@@Immediate];;

type t = I of int [@@Immediate] [@@unboxed]

external id : t -> t = "%identity";;

Characters 0-34:
external id : t -> t = "%identity";;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 61: This primitive declaration uses type t, which is unannotated and
unboxable. The representation of such types may change in future
versions. You should annotate the declaration of t with [@@boxed]
or [@@unboxed].
Characters 0-34:
external id : t -> t = "%identity";;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 61: This primitive declaration uses type t, which is unannotated and
unboxable. The representation of such types may change in future
versions. You should annotate the declaration of t with [@@boxed]
or [@@unboxed].
external id : t -> t = "%identity"

external id : (t [@unboxed]) -> (t [@unboxed]) = "%identity";;

Characters 15-16:
external id : (t [@unboxed]) -> (t [@unboxed]) = "%identity";;
^
Error: Don't know how to unbox this type. Only float, int32, int64 and nativeint can be unboxed

@vicuna
Copy link
Author

vicuna commented Sep 3, 2018

Comment author: smuenzel-js

Fixed by #1935:

#1935

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