You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems when we have arrays and variables with upcased names, nestml generates the code without any problem, but the code won't compile for the following reasons, but first let's demonstrate the problem.
Again, we start with a simple model that should cause the problem:
neuron names_conflicts:
state:
Y_1 real = 42.
x[N] real = 1.
end
parameters:
N integer = 1 # array size
end
end
Here, we have an array x and a double variable named Y_1, and the generated C++ block for the state struct is the following:
Y_1 was declared twice, first as part of enum and then as double in the same State_ struct, thus the compilation of the code won't be successful, and the compiler throws the following error: ` double names_conflicts::State_::Y_1 conflicts with a previous declaration´.
The text was updated successfully, but these errors were encountered:
As long as we use arrays, we aren't allowed to use upcased variables names, even for arrays themselves.
med-ayssar
changed the title
Can't have variable with upcased name when having arrays
Can't have variable with upcased name when using arrays
Apr 24, 2022
It seems when we have arrays and variables with
upcased
names,nestml
generates the code without any problem, but the code won't compile for the following reasons, but first let's demonstrate the problem.Again, we start with a simple model that should cause the problem:
Here, we have an array
x
and a double variable namedY_1
, and the generatedC++
block for the state struct is the following:Y_1
was declared twice, first as part ofenum
and then as double in the sameState_
struct, thus the compilation of the code won't be successful, and the compiler throws the following error: ` double names_conflicts::State_::Y_1 conflicts with a previous declaration´.The text was updated successfully, but these errors were encountered: