Skip to content

[TS] Less expression #302

Merged
Lipen merged 2 commits intomainfrom
caelmbleidd/lt
Jul 11, 2025
Merged

[TS] Less expression #302
Lipen merged 2 commits intomainfrom
caelmbleidd/lt

Conversation

@CaelmBleidd
Copy link
Copy Markdown
Member

@CaelmBleidd CaelmBleidd commented Jul 8, 2025

< and > operators extended support

@CaelmBleidd CaelmBleidd requested a review from Copilot July 8, 2025 13:19
github-advanced-security[bot]

This comment was marked as spam.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new TypeScript sample for < comparisons across several types, adds corresponding Kotlin tests, refactors the binary-operator backend to unify fake-object logic, renames a generic parameter for clarity, and updates a demo test target.

  • Added Less.ts with lessNumbers, lessBooleans, lessMixed, lessRefs, and lessUnknown.
  • Added Kotlin Less.kt tests to exercise the new TS methods.
  • Refactored TsBinaryOperator implementations to use commonResolveFakeObject.
  • Renamed generic parameter in EtsFakeType.kt and updated the DemoPhotos test to target onCreate.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
usvm-ts/src/test/resources/samples/operators/Less.ts New TS sample for < operator on numbers, booleans, mixed, refs, unknown
usvm-ts/src/test/kotlin/org/usvm/samples/operators/Less.kt Kotlin tests added for each lessX method
usvm-ts/src/test/kotlin/org/usvm/project/DemoPhotos.kt Updated test selection from onSelect/AlbumSetPage to onCreate/EntryAbility
usvm-ts/src/main/kotlin/org/usvm/machine/types/EtsFakeType.kt Renamed type-parameter from Sort to T in ExprWithTypeConstraint
usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt Consolidated fake-object resolution into commonResolveFakeObject
Comments suppressed due to low confidence (4)

usvm-ts/src/test/kotlin/org/usvm/project/DemoPhotos.kt:108

  • [nitpick] The test function name (test on particular method) no longer matches the updated target (onCreate/EntryAbility); consider renaming the test or updating its comment to reflect the new behavior.
            .single { it.name == "onCreate" && it.enclosingClass?.name == "EntryAbility" }

usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt:102

  • [nitpick] Add KDoc for commonResolveFakeObject explaining the purpose of bottomValueSort and the reduce lambda to improve maintainability.
    fun <R : USort> TsBinaryOperator.commonResolveFakeObject(

usvm-ts/src/main/kotlin/org/usvm/machine/types/EtsFakeType.kt:46

  • [nitpick] The generic parameter T is less descriptive than the previous Sort; consider using a more meaningful name (e.g., Sort) for clarity.
data class ExprWithTypeConstraint<T : USort>(

usvm-ts/src/test/kotlin/org/usvm/samples/operators/Less.kt:50

  • The testLessRefs and testLessUnknown calls have no property assertions; add expected-result lambdas to verify behavior for reference and unknown comparisons.
        discoverProperties<TsTestValue.TsClass, TsTestValue.TsClass, TsTestValue.TsBoolean>(

Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt Outdated
@CaelmBleidd CaelmBleidd requested a review from Lipen July 9, 2025 07:44
Copy link
Copy Markdown
Member

@Lipen Lipen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, but some style changes are necessary! 🦀

Comment thread usvm-ts/src/test/resources/samples/operators/Less.ts
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt Outdated
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt Outdated
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/types/EtsFakeType.kt Outdated
@CaelmBleidd CaelmBleidd requested a review from Lipen July 10, 2025 09:16
Comment thread usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt Dismissed
@Lipen Lipen merged commit 7a5af5f into main Jul 11, 2025
6 checks passed
@Lipen Lipen deleted the caelmbleidd/lt branch July 11, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants