AScan generic and codeblock types
Posted: Fri Dec 02, 2022 10:59 am
Hi all,
I've got a quick syntaxic question about how to use generic functions.
In our project we now have a compilation error (Xsharp 2.13) that wasn't happenning in 2.12.
The culprit is there :
So aArtDetList is a typed list and it bothers AScan.
There is a generic version of AScan so I tried
But then I've got
FIne ! then I don't need to type oItem as it should infer from the generic type right ?
... nope :
Should I translate the codeblock as a lambda function (I'd rather not)
Regards
I've got a quick syntaxic question about how to use generic functions.
In our project we now have a compilation error (Xsharp 2.13) that wasn't happenning in 2.12.
Code: Select all
Erreur XS1503 Argument 1: cannot convert from 'array of<ArtDet>' to 'array'
Code: Select all
LOCAL aArtDetList AS ARRAY OF ArtDet
AScan( aArtDetList, { |oItem AS ArtDet| oItem:CodeArt == oArtLivr:CODEART .AND. oItem:EtatOccaz == oArtLivr:ETATOCCAZ } )
There is a generic version of AScan so I tried
Code: Select all
AScan<ArtDet>( aArtDetList, { |oItem AS ArtDet| oItem:CodeArt == oArtLivr:CODEART .AND. oItem:EtatOccaz == oArtLivr:ETATOCCAZ } )
Code: Select all
Erreur XS1503 Argument 2: cannot convert from 'codeblock' to 'ArtDet'
Code: Select all
AScan<ArtDet>( aArtDetList, { |oItem| oItem:CodeArt == SELF:oFacDet:CODEART .AND. oItem:EtatOccaz == SELF:oFacDet:ETATOCCAZ } )
Code: Select all
Erreur XS1061 'usual' does not contain a definition for 'CodeArt' and no accessible extension method 'CodeArt' accepting a first argument of type 'usual' could be found
Regards