Quick actions

cmd+k|ctrl+k

Navigation

Languages

Recursive Type SegFault

Snippet info

Language

Ats

Visibility

public

Author

steinwaywhw

Created

2016-09-26T19:08:43Z

Updated

2016-09-26T23:06:14Z

#include "share/atspre_staload.hats"

abstype point (a:t@ype)     = ptr 
abstype variable            = ptr 
abstype structure (a:t@ype) = ptr 

typedef descriptor = $tup(int, ref int, ref (structure variable))

// un-comment this line will cause seg-fault, probably due to recursive type. 
//assume variable = point (descriptor) 

local 

fun mk (id:int, rank:int, s:structure variable): descriptor = $tup(id, ref rank, ref s)

in 

implement main0 () = print"Hello World!\n"

end
INFO