Change how new operators are compiled.
Instead of an instruction that always instantiates an instance,
the "new" is compiled to a method call on the class, followed by a
method call on the (presumably) new instance.
The former lets built-in types like Fn do special stuff instead of
allocating an instance. In particular, it means:
new Fn { ... }
can just return the block argument.
This commit is contained in:
@@ -428,7 +428,7 @@ class Variable {
|
||||
|
||||
// Removes all traces of c from this variable.
|
||||
removeConstraint(constraint) {
|
||||
_constraints = _constraints.where(fn (c) c != constraint)
|
||||
_constraints = _constraints.where { |c| c != constraint }
|
||||
if (_determinedBy == constraint) _determinedBy = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user