@@ -151,12 +151,12 @@ class Objects(using Context @constructorOnly):
151
151
def hasVar (sym : Symbol )(using Heap .MutableData ): Boolean = Heap .containsVal(this , sym)
152
152
153
153
def initVal (field : Symbol , value : Value )(using Context , Heap .MutableData ) = log(" Initialize " + field.show + " = " + value + " for " + this , printer) {
154
- assert(field.is( Flags . Param ) || ! field.is(Flags .Mutable ), " Field is mutable: " + field.show)
154
+ assert(! field.is(Flags .Mutable ), " Field is mutable: " + field.show)
155
155
Heap .writeJoinVal(this , field, value)
156
156
}
157
157
158
158
def initVar (field : Symbol , value : Value )(using Context , Heap .MutableData ) = log(" Initialize " + field.show + " = " + value + " for " + this , printer) {
159
- assert(field.is(Flags .Mutable , butNot = Flags . Param ), " Field is not mutable: " + field.show)
159
+ assert(field.is(Flags .Mutable ), " Field is not mutable: " + field.show)
160
160
Heap .writeJoinVal(this , field, value)
161
161
}
162
162
@@ -421,12 +421,12 @@ class Objects(using Context @constructorOnly):
421
421
def hasVar (sym : Symbol )(using EnvMap .EnvMapMutableData ): Boolean = EnvMap .containsVal(this , sym)
422
422
423
423
def initVal (field : Symbol , value : Value )(using Context , EnvMap .EnvMapMutableData ) = log(" Initialize " + field.show + " = " + value + " for " + this , printer) {
424
- assert(field.is( Flags . Param ) || ! field.is(Flags .Mutable ), " Field is mutable: " + field.show)
424
+ assert(! field.is(Flags .Mutable ), " Field is mutable: " + field.show)
425
425
EnvMap .writeJoinVal(this , field, value)
426
426
}
427
427
428
428
def initVar (field : Symbol , value : Value )(using Context , EnvMap .EnvMapMutableData ) = log(" Initialize " + field.show + " = " + value + " for " + this , printer) {
429
- assert(field.is(Flags .Mutable , butNot = Flags . Param ), " Field is not mutable: " + field.show)
429
+ assert(field.is(Flags .Mutable ), " Field is not mutable: " + field.show)
430
430
EnvMap .writeJoinVal(this , field, value)
431
431
}
432
432
@@ -527,7 +527,7 @@ class Objects(using Context @constructorOnly):
527
527
_of(Map .empty, byNameParam, thisV, outerEnv)
528
528
529
529
def setLocalVal (x : Symbol , value : Value )(using scope : Scope , ctx : Context , heap : Heap .MutableData , envMap : EnvMap .EnvMapMutableData ): Unit =
530
- assert(x.is (Flags .Param ) || ! x.is( Flags .Mutable ), " Only local immutable variable allowed" )
530
+ assert(! x.isOneOf (Flags .Param | Flags .Mutable ), " Only local immutable variable allowed" )
531
531
scope match
532
532
case env : EnvRef =>
533
533
env.initVal(x, value)
@@ -1806,6 +1806,7 @@ class Objects(using Context @constructorOnly):
1806
1806
val toSeqResTp = resultTp.memberInfo(selectors.last).finalResultType
1807
1807
evalSeqPatterns(toSeqRes, toSeqResTp, elemTp, seqPats)
1808
1808
end if
1809
+ // TODO: refactor the code of product sequence match, avoid passing NoType to parameter elemTp in evalSeqPatterns
1809
1810
1810
1811
else
1811
1812
// distribute unapply to patterns
0 commit comments