-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: main
Are you sure you want to change the base?
TS type streams #274
Conversation
There was a problem hiding this 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.
989c4d8
to
5b944ce
Compare
@@ -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
There was a problem hiding this 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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 -> |
There was a problem hiding this comment.
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.
No description provided.