File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
src/main/kotlin/io/runescript/plugin/lang/psi/type Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 16
16
- Fix a bug with script block indentation.
17
17
- Fix missing indentation for file block.
18
18
- Fix type checking for expression lists.
19
+ - Fix type checking when there is a type error.
19
20
20
21
## [ 1.2.0] - 2023-08-18
21
22
Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ fun Iterable<RsType>.flatten(): Array<RsType> {
35
35
for (type in this ) {
36
36
when (type) {
37
37
is RsTupleType -> flattened.addAll(type.types)
38
- is RsPrimitiveType -> flattened.add(type)
39
- is RsArrayType -> flattened.add(type)
40
- is RsTypeType -> flattened.add(type)
41
- else -> error(" Called flatten() on non primitive type array: ${type::class } " )
38
+ else -> flattened.add(type)
42
39
}
43
40
}
44
41
return flattened.toTypedArray()
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV
99
99
}
100
100
101
101
private fun RsType?.unfold (): RsType ? {
102
- if (this is RsTupleType && types.size == 1 ) return types[0 ]
102
+ if (this is RsTupleType && types.size == 1 ) {
103
+ return types[0 ]
104
+ }
103
105
return this
104
106
}
105
107
@@ -119,6 +121,12 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV
119
121
if (unfoldedActualType is RsErrorType || unfoldedExpectedType is RsErrorType ) {
120
122
return
121
123
}
124
+ if (unfoldedActualType is RsTupleType && RsErrorType in unfoldedActualType.types) {
125
+ return
126
+ }
127
+ if (unfoldedExpectedType is RsTupleType && RsErrorType in unfoldedExpectedType.types) {
128
+ return
129
+ }
122
130
if (unfoldedExpectedType == RsPrimitiveType .OBJ && unfoldedActualType == RsPrimitiveType .NAMEDOBJ ) {
123
131
// namedobj extends obj
124
132
return
You can’t perform that action at this time.
0 commit comments