Skip to content

Add call/field resolver, disable AA type inference#264

Merged
Lipen merged 1 commit intomainfrom
lipen/ts-resolver
Feb 26, 2025
Merged

Add call/field resolver, disable AA type inference#264
Lipen merged 1 commit intomainfrom
lipen/ts-resolver

Conversation

@Lipen
Copy link
Copy Markdown
Member

@Lipen Lipen commented Feb 26, 2025

This PR adds simple (yet better than it was before) call/field resolver.

Also, we decided to turn off ArkAnalyzer's type inference in order to test and evaluate our SE engine more carefully in situation when most of the value have unknown types. Known types are beneficial, but currently we might unconsciously rely on their presence too much. Fixing the issues with call/field resolver in this PR allowed to pass the test suite we already have. If necessary, AA's type inference can be enable via an option during the scene loading.

@Lipen Lipen requested a review from CaelmBleidd February 26, 2025 11:42
Comment on lines +570 to +571

// Perfect signature:

Check warning

Code scanning / detekt

Reports methods that have an empty first line. Warning

First line in a method block should not be empty
val clazz = classes.single()
return clazz.fields.single { it.name == field.name }
}
val fields = classes.flatMap { it.fields.filter { it.name == field.name } }

Check warning

Code scanning / detekt

Disallow shadowing variable declarations. Warning

Name shadowed: implicit lambda parameter 'it'
val fields = classes.flatMap { it.fields.filter { it.name == field.name } }
if (fields.size == 1) return fields.single()
} else {
val fields = ctx.scene.projectAndSdkClasses.flatMap { it.fields.filter { it.name == field.name } }

Check warning

Code scanning / detekt

Disallow shadowing variable declarations. Warning

Name shadowed: implicit lambda parameter 'it'
@Lipen Lipen merged commit fb0614d into main Feb 26, 2025
6 checks passed
@Lipen Lipen deleted the lipen/ts-resolver branch February 26, 2025 12:41
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.

3 participants