Add useDefaultSemantics() to Enviornment.Builder
RELNOTES: None
@@ -612,7 +612,10 @@ public final class Environment implements Freezable {
}
/**
- * A Builder class for Environment
+ * A Builder class for Environment.
+ *
+ * <p>The caller must explicitly set the semantics by calling either {@link #setSemantics} or
+ * {@link #useDefaultSemantics}.
*/
public static class Builder {
private final Mutability mutability;
@@ -655,6 +658,11 @@ public final class Environment implements Freezable {
return this;
}
+ public Builder useDefaultSemantics() {
+ this.semantics = SkylarkSemantics.DEFAULT_SEMANTICS;
+ return this;
+ }
+
/** Sets an EventHandler for errors and warnings. */
public Builder setEventHandler(EventHandler eventHandler) {
Preconditions.checkState(this.eventHandler == null);
