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
I want to be able to specify a whitelist of variables that needs to be present in the provided scope. No other variables are allowed.
Something like:
val conditions = listOf(
noneExcept(VAR1, VAR2),
hasValue(VAR1, "foo"),
matches(VAR2) { it > 234 }
)
The problem with the noneExcept condition is, that it can not be defined on a singleVariableFactory and thus is not matching the abstract class VariableFactoryCondition<T>.
Alternative approach would be to define a new Guard, which is checking conditions on the whole context (like in this case).
The text was updated successfully, but these errors were encountered:
The problem is the signature. hasOnly(varargs factories: VariableFactory) means that the return type of this method is not an VariableGuardCondition<T>, because of:
abstract class VariableGuardCondition<T>(
internal val variableFactory: VariableFactory<T>,
internal val local: Boolean = false
) { ... }
It is not a guard on one factory, but on the entire context....
Scenario
I want to be able to specify a whitelist of variables that needs to be present in the provided scope. No other variables are allowed.
Something like:
The problem with the
noneExcept
condition is, that it can not be defined on a singleVariableFactory
and thus is not matching the abstract classVariableFactoryCondition<T>
.Alternative approach would be to define a new Guard, which is checking conditions on the whole context (like in this case).
The text was updated successfully, but these errors were encountered: