Skip to content

TS type streams #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open

TS type streams #274

wants to merge 50 commits into from

Conversation

CaelmBleidd
Copy link
Member

No description provided.

@CaelmBleidd CaelmBleidd changed the title Caelmbleidd/type stream TS type streams Apr 23, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@CaelmBleidd CaelmBleidd force-pushed the caelmbleidd/type-stream branch from 989c4d8 to 5b944ce Compare April 30, 2025 13:07
@@ -130,22 +135,34 @@
return scope.stepResult()
}

private fun visitVirtualMethodCall(scope: TsStepScope, stmt: TsVirtualMethodCallStmt) {
private fun visitVirtualMethodCall(scope: TsStepScope, stmt: TsVirtualMethodCallStmt) = with(ctx) {

Check warning

Code scanning / detekt

Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand. Warning

Function visitVirtualMethodCall is nested too deeply.
@CaelmBleidd CaelmBleidd marked this pull request as ready for review May 5, 2025 10:43
@CaelmBleidd CaelmBleidd requested a review from Lipen May 5, 2025 10:43
Copy link
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.

LGTM

val concreteRef = scope.calcOnState { models.first().eval(instance) }

val uncoveredInstance = if (concreteRef.isFakeObject()) {
// We ignore the possibility of method call on primitives.
Copy link
Member

Choose a reason for hiding this comment

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

We should not ignore method calls on primitives. toString and toFixed are quite common for numbers.

@@ -0,0 +1,23 @@
package org.usvm.samples.types
Copy link
Member

Choose a reason for hiding this comment

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

Why use sub-folder for these samples? All samples are different, and "types-related" samples are not any more special than others. They all should be organize in a flat structure. The alternative is to introduce a complex hierarchy of samples, but this is a dead end --- flat a better.

@@ -323,36 +323,52 @@ open class TsTestStateResolver(
}

private fun resolveClass(
classType: EtsClassType,
refType: EtsRefType,
Copy link
Member

Choose a reason for hiding this comment

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

Keep in mind that EtsRefType might be not what you have expected.

}
val interfaces = currentClass.implementedInterfaces
require(interfaces.isEmpty()) { TODO() }
val resolvedInterfaces = interfaces.map { interfaceSignature ->
Copy link
Member

Choose a reason for hiding this comment

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

In the line above you require interfaces to be empty, but here you still handle non-empty implemented interfaces.

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.

2 participants