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

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Sep 3, 2018

Comment author: smuenzel-js

Fixed by #1935:

#1935

@vicuna vicuna closed this Sep 3, 2018

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.