I am using closures as struct parameters. As these closures typically are defined on top level in my case, I omitted further specification in the struct definition:
def fun() -> Int:
return 42
struct S[fun: def() -> Int]:
pass
Now I get the warning “omitting ‘thin’ in function types is deprecated; specify ‘capturing’, ‘unified’, or ‘thin’”. Specifying thin seems to do the trick. However, the name unified suggests that this closure type should work as well. This is not the case for top level functions.
Which type should be used when? unified for capturing / non-toplevel functions and thin else?