Closed okeuday closed 3 years ago
This is due to very limited support for overloading in ATS2. Already fixed in ATS3. The following code compiles without any issues:
fn {s:t@ype}
print_state {l:agz}
( state_pfgc : !s @ l
| state_p: ptr l ) : void =
let
val state_s: s = $UN.ptr0_get<s>(state_p)
in
fprint_val<s>(stdout_ref, state_s)
end
implement
main0 () = let
var state: int = 42
in
print_state<int>(view@state | addr@state)
end
Thank you for the information
An example of this problem is below:
If changed to print
state_s
the attempt to print will fail due to theS2Eerrexp()
term. Thestate_s
value should be able to print with the same output provided forstate
, right? Is this something that should work in the future?