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
A user defined function taking a float does not automatically promote an int to float but fails instead. The reason seems to be that function inlining translates the fucntion into a flwor expression with the treat iterator being too strong (not allowing promotion). Disabling function inlining fixes the issue for this specific example
Example:
declarefunctionlocal:square($arg as xs:float) as xs:float { $arg * $arg };
local:square(7)
FunctionRuntimeIterator | local | <anonymous> | simple | non-sequential | Variable dependencies:
ProgramIterator | local | xs:float | simple | non-sequential | Variable dependencies:
StatementsWithExprIterator | local | xs:float | simple | non-sequential | Variable dependencies:
TreatIterator | local | xs:float | simple | non-sequential | Variable dependencies:
ReturnClauseSparkIterator | local | Variable dependencies:
LetClauseSparkIterator
Dynamic context variable dependencies:
Input variable dependencies:
Output variable dependencies: arg(FULL)
Variables bound in current FLWOR: arg
Height: 0
Limit: -1
Variable arg
IntegerRuntimeIterator | local | xs:integer | simple | non-sequential | Variable dependencies:
StatementsWithExprIterator | local | xs:integer | simple | non-sequential | Variable dependencies: arg(FULL)
MultiplicativeOperationIterator | local | xs:integer | simple | non-sequential | Variable dependencies: arg(FULL)
VariableReferenceIterator | local | xs:integer | simple | non-sequential | Variable dependencies: arg(FULL)
VariableReferenceIterator | local | xs:integer | simple | non-sequential | Variable dependencies: arg(FULL)
⚠️ ️There was an error on line 2 in file:/Users/marco/Documents/MscThesis/repo/rumble/:
local:square(7)
^
Code: [XPTY0004]
Message: xs:int is not expected here. The expected type is xs:float
The text was updated successfully, but these errors were encountered:
A user defined function taking a float does not automatically promote an int to float but fails instead. The reason seems to be that function inlining translates the fucntion into a flwor expression with the treat iterator being too strong (not allowing promotion). Disabling function inlining fixes the issue for this specific example
Example:
The text was updated successfully, but these errors were encountered: