You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems odd given that a concept is able to successfully interrogate a type itself has some properties. But something blocks passing the type itself even after the concept clears it as OK.
local FlompFn = @function(self: pointer, msg: string)
local FlompDg = @record{
data: pointer,
func: FlompFn,
}
local some_delegate = #[concept(function(attr)
if attr.value.is_record and
attr.value.fields['data'] and
attr.value.fields['data'].type.is_pointer and
attr.value.fields['func'] and
attr.value.fields['func'].type.is_function then
return true
end
return false
end)]#
local some_function = #[concept(function(attr)
return attr.type.is_function
end)]#
local some_pointer = #[concept(function(attr)
return attr.type.is_pointer
end)]#
local function wrap(dg: some_delegate, data: some_pointer, fn: some_function): isize
return 0 --dg{data=data, func=fn}
end
local Object = @record{
yeet: string
}
function Object:flomp(msg: string)
print("instance ", self.yeet, " is flomping: ", msg)
end
local o: Object
local k = wrap(FlompDg, &o, Object.flomp)
functors.nelua:70:15: error: in call of function 'wrap' at argument 1: invalid return for concept 'some_delegate': cannot be of the type 'type'
local k = wrap(FlompDg, &o, Object.flomp)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This seems odd given that a concept is able to successfully interrogate a type itself has some properties. But something blocks passing the type itself even after the concept clears it as OK.
Beta Was this translation helpful? Give feedback.
All reactions