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
funcdef's are one of the weirder AS types, since they are handles but they can't be directly "assigned" to (that is to say, F @d; d = a; is an error, apparently because they are const but I wish it would allow it to just act as a regular handle assignment).
Anyways, assignment in any context is busted for them, and secondarily the langserv reports an error if attempting to invoke a funcdef value from a class.
classBar
{
foo_f @f;
}
funcdef void foo_f(Bar &);void foo_impl(Bar &)
{
}
void f(foo_f @)
{
}
voidtest()
{
Bar b;
foo_f @func;
// error: Invalid operation 'opAssign' between 'void(Bar)@' and 'void(Bar)'// but is valid AS.
@func = foo_impl;
// no error; correct
func(b);
// error: Cannot convert 'void(Bar)@' to parameter type 'void(Bar)@'// but is valid AS.
f(func);
// error: Invalid operation 'opAssign' between 'void(Bar)@' and 'void(Bar)'// but is valid AS.
@b.f = foo_impl;
// error: 'f' is not a method.// but is valid AS
b.f(b);
// error: Invalid operation 'opAssign' between 'void(Bar)@' and 'void(Bar)'.// this is correct error and AS will error on this line.// AS Error: ERR : Can't implicitly convert from 'foo_f@const' to 'const foo_f&'.
func = foo_impl;
}
The text was updated successfully, but these errors were encountered:
Paril
changed the title
funcdef assignment causes errors
funcdef assignment causes errors (+ invoking funcdef as member)
Jan 1, 2025
funcdef's are one of the weirder AS types, since they are handles but they can't be directly "assigned" to (that is to say,
F @d; d = a;
is an error, apparently because they are const but I wish it would allow it to just act as a regular handle assignment).Anyways, assignment in any context is busted for them, and secondarily the langserv reports an error if attempting to invoke a funcdef value from a class.
The text was updated successfully, but these errors were encountered: