File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/main/kotlin/io/runescript/plugin/lang/psi/type/inference Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 17
17
- Fix missing indentation for file block.
18
18
- Fix type checking for expression lists.
19
19
- Fix type checking when there is a type error.
20
+ - Fix type checking for varbit game variables.
20
21
21
22
## [ 1.2.0] - 2023-08-18
22
23
Original file line number Diff line number Diff line change @@ -328,11 +328,21 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV
328
328
329
329
override fun visitScopedVariableExpression (o : RsScopedVariableExpression ) {
330
330
val reference = o.reference?.resolve() as ? RsSymSymbol
331
- if (reference == null || reference.fieldList.size < 3 ) {
331
+ if (reference == null ) {
332
332
o.type = RsErrorType
333
333
return
334
334
}
335
- o.type = RsPrimitiveType .lookupReferencableOrNull(reference.fieldList[2 ].text) ? : RsErrorType
335
+ val isVarbit = reference.containingFile.virtualFile.nameWithoutExtension == " varbit"
336
+ if (isVarbit) {
337
+ o.type = RsPrimitiveType .INT
338
+ } else {
339
+ if (reference.fieldList.size < 3 ) {
340
+ o.error(" Missing type field for game variable symbol" )
341
+ o.type = RsErrorType
342
+ return
343
+ }
344
+ o.type = RsPrimitiveType .lookupReferencableOrNull(reference.fieldList[2 ].text) ? : RsErrorType
345
+ }
336
346
}
337
347
338
348
override fun visitLocalVariableExpression (o : RsLocalVariableExpression ) {
You can’t perform that action at this time.
0 commit comments