[TS] Bug with add operator
@CaelmBleidd is already working on this.
Since Jul 11, 2025.
Assessment
This issue has not been assessed yet.
Description
Sometimes there is a bug with bool + ref sorts inside of the add operator, 6% of tests maybe.
The issue is that this construction is prohibites, so current implementation is not correct. We need to fix it.
Failed run:
[INFO] TestRunnerKt - 5 executions were found:
TsTest(method=Add::addUnknownValues(a: unknown, b: unknown): number, before=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsUndefined, TsDouble(value=0.0)], globals={}), after=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsUndefined, TsDouble(value=0.0)], globals={}), returnValue=TsDouble(value=NaN), trace=[])
TsTest(method=Add::addUnknownValues(a: unknown, b: unknown): number, before=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsBoolean(value=true), TsNull], globals={}), after=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsBoolean(value=true), TsNull], globals={}), returnValue=TsDouble(value=NaN), trace=[])
TsTest(method=Add::addUnknownValues(a: unknown, b: unknown): number, before=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsDouble(value=7.0)], globals={}), after=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsDouble(value=7.0)], globals={}), returnValue=TsDouble(value=7.0), trace=[])
TsTest(method=Add::addUnknownValues(a: unknown, b: unknown): number, before=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsNull], globals={}), after=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsNull], globals={}), returnValue=TsDouble(value=0.0), trace=[])
TsTest(method=Add::addUnknownValues(a: unknown, b: unknown): number, before=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsBoolean(value=false)], globals={}), after=TsParametersState(thisInstance=TsClass(name=Add, properties={}), parameters=[TsNull, TsBoolean(value=false)], globals={}), returnValue=TsDouble(value=42.0), trace=[])
Extracted values:
[TsUndefined, TsDouble(value=0.0), TsDouble(value=NaN)]
[TsBoolean(value=true), TsNull, TsDouble(value=NaN)]
[TsNull, TsDouble(value=7.0), TsDouble(value=7.0)]
[TsNull, TsNull, TsDouble(value=0.0)]
[TsNull, TsBoolean(value=false), TsDouble(value=42.0)]
- Dominant language
- Kotlin
- Stars
- 33
- Forks
- 27
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 15
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UnitTestBot/usvm
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
UnitTestBot/usvm#388 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
UnitTestBot/usvm#384 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
UnitTestBot/usvm#382 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
UnitTestBot/usvm#379 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
UnitTestBot/usvm#373 ·
All issues in UnitTestBot/usvm
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
helsemelding-json-schema json-schema-core
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
contributor: external needs review
Difficulty 2/5 1-3 hours Newbie friendliness 82/100