Menu

#991 Missing error check for unsupported overloaded operators

closed
nobody
None
compiler
2024-04-07
2023-11-04
No

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.

Related

Feature Requests: #285

Discussion

  • Jeff Marshall

    Jeff Marshall - 2024-04-07
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB