Skip to content

Commit

Permalink
Merge pull request #559 from smeup/bugfix/LS24003149/immutable-for-en…
Browse files Browse the repository at this point in the history
…dvalue

Bugfix/ls24003149/immutable for endvalue
  • Loading branch information
lanarimarco authored Jul 4, 2024
2 parents 695b2b5 + 9c513d2 commit 2afa798
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ fun Node.transformChildren(operation: (Node) -> Node, inPlace: Boolean = false):
if (p is KMutableProperty<*>) {
p.setter.call(this, newValue)
} else {
/**
* The following exception is raised when the property we are trying to replace is immutable.
* This usually happens when it is declared as `val` or it is a getter without a setter.
* If for some reason you are sure the property must be replaced please check that it is
* declared as `var` field or add a setter to it in the corresponding superclass of Node
* that defines the target property.
*/
throw ImmutablePropertyException(p, v)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ data class CabStmt(
@Serializable
data class ForStmt(
var init: Expression,
val endValue: Expression,
var endValue: Expression,
val byValue: Expression,
val downward: Boolean = false,
override val body: List<Statement>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,14 @@ open class MULANGT02ConstAndDSpecTest : MULANGTTest() {
val expected = listOf("ok")
assertEquals(expected, "smeup/MUDRNRAPU00222".outputOf(configuration = smeupConfig))
}

/**
* Access to an array detected as a function call by parser
* @see #LS24003149
*/
@Test
fun executeMUDRNRAPU00224() {
val expected = listOf("ok")
assertEquals(expected, "smeup/MUDRNRAPU00224".outputOf(configuration = smeupConfig))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
D £DBG_Str S 2
D DS
D SMET 100 DIM(60)
D SMET_NUM 07 0 OVERLAY(SMET:*NEXT)
D $B S 06 0
D $GRU_A S 02 0
C EVAL $GRU_A=2
C FOR $B=1 TO SMET_NUM($GRU_A)
C ENDFOR
C EVAL £DBG_Str='ok'
C £DBG_Str DSPLY

0 comments on commit 2afa798

Please sign in to comment.