blob: e58705dc50656ff975f6a6daaed661ec4d1b81f9 [file] [log] [blame]
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
extension type Int(int i) implements int {
Int operator +(int other) {
return Int(i + other);
}
}
void test() {
int a = 2;
Int b = Int(8); /* Ok */
b = b + a; /* Ok */
b = a + b; /* Error */
a = a + b; /* Ok */
print(a + b); /* Ok */
}