Deprecate old boolean constructor and move existing usages

This commit is contained in:
altrisi committed 2021-05-24 11:41:24 +02:00
1 parent 1b39feaab7
commit 9d9844fd5d
14 files changed
+59 -47

No files matched your search

@@ -4,6 +4,7 @@ import carpet.script.Expression;
import carpet.script.argument.FunctionArgument;
import carpet.script.exception.ExitStatement;
import carpet.script.exception.InternalExpressionException;
import carpet.script.value.BooleanValue;
import carpet.script.value.NumericValue;
import carpet.script.value.ThreadValue;
import carpet.script.value.Value;
@@ -62,7 +63,7 @@ public class Threading
{
if (!(v instanceof ThreadValue))
throw new InternalExpressionException("'task_completed' could only be used with a task value");
return new NumericValue(((ThreadValue) v).isFinished());
return BooleanValue.of(((ThreadValue) v).isFinished());
});
// lazy cause expr is evaluated in the same type