hades-lang
hades-lang copied to clipboard
Uninferrable type argument
import hades.memory as Mem
struct Box[T] {
val _ptr: *mut T
}
def new_box[T](): Box[T] {
// Uninferrable T even though return type annotation
// should be enough to infer the type argument here
return Box(Mem.allocate(1))
// this works as a workaround
// return Box[T](Mem.allocate(1))
}