mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
Special treatment for ..True and ..False (#9767)
This commit is contained in:
parent
4a97bfa31f
commit
96fdb67204
@ -241,6 +241,13 @@ public final class UnresolvedConstructor implements EnsoObject {
|
||||
UnresolvedConstructor unresolved,
|
||||
State state,
|
||||
DirectCallNode callNode) {
|
||||
var builtins = EnsoContext.get(callNode).getBuiltins();
|
||||
if (c == builtins.bool().getTrue()) {
|
||||
return true;
|
||||
}
|
||||
if (c == builtins.bool().getFalse()) {
|
||||
return false;
|
||||
}
|
||||
var fn = c.getConstructorFunction();
|
||||
var args = new Object[prototype.descs.length + 1];
|
||||
System.arraycopy(unresolved.args, 0, args, 1, prototype.descs.length);
|
||||
|
@ -439,6 +439,13 @@ add_specs suite_builder =
|
||||
foo = v:Foo
|
||||
Foo.Value 10 . should_equal foo
|
||||
|
||||
group_builder.specify "..False can be autoscoped" <|
|
||||
|
||||
bool b:Boolean = b
|
||||
|
||||
f = bool ..False
|
||||
f.not . should_be_true
|
||||
|
||||
group_builder.specify "Autoscope to two different values" <|
|
||||
|
||||
v = ..Value 10
|
||||
|
Loading…
Reference in New Issue
Block a user