fbc should probably show the error at the declaration rather than the expression
type T
__ as integer
declare constructor( a() as integer ) '' supported
declare operator let (a() as integer) '' not-supported (but no error)
declare operator += (a() as integer) '' not-supported (but no error)
end type
dim as integer n(1 to 5) = { 1, 2, 3, 4 }
dim x as T = T( n() ) '' supported
var y = new T( n() ) '' supported
*y = n() '' error shows here instead of declaration
*y += n() '' error shows here instead of declaration
delete y
Or add a feature to allow non-indexed arrays (i.e. a()) as operands in expression and call the appropriate overloaded operator.
Fixed in fbc-1.20.0 by allowing non-indexed arrays as operands in expressions:
Feature added in fbc-1.20.0
commit [d381789063deac4407789f4eebdc43056d2c8e96], and
commit [42dce7505f84cc58e569ab14d6439e5297bd5cc8]
Related
Commit: [42dce7]
Commit: [d38178]