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
The when clause for an implementation treats Unknown values as if they were true, i.e. it emits the implementation. This is not consistent with the behavior of if. Example model that illustrates both behaviors below.
entity A:
string name
bool condition
end
implement A using conditional when self.condition
implement A using always
implementation conditional for A:
std::print(f"implementation triggered for {self.name}!")
end
implementation always for A:
if self.condition:
std::print(f"if body triggered for {self.name}!")
end
end
unknown = std::get_env("THIS_ENV_VAR_DOES_NOT_EXIST")
A(name="true", condition=true)
A(name="false", condition=false)
A(name="unknown", condition=unknown)
The output is
implementation triggered for true!
implementation triggered for unknown!
if body triggered for true!
The text was updated successfully, but these errors were encountered:
The
when
clause for an implementation treatsUnknown
values as if they weretrue
, i.e. it emits the implementation. This is not consistent with the behavior ofif
. Example model that illustrates both behaviors below.The output is
The text was updated successfully, but these errors were encountered: