mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:29:48 +00:00
d4fb6b320c
Fixes #43114. Bug: https://github.com/dart-lang/sdk/issues/43114 Change-Id: Ib0adf67c5ac5189732960a5925d7cdbcff0c4102 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180441 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
24 lines
597 B
Dart
24 lines
597 B
Dart
// Copyright (c) 2020, 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.
|
|
|
|
/// Regression test for https://github.com/dart-lang/sdk/issues/43114.
|
|
|
|
class A {}
|
|
|
|
extension E on A {
|
|
String operator +(int other) => '';
|
|
}
|
|
|
|
f(A a, int b) {
|
|
int i = E(a) + b;
|
|
// ^^^^^^^^
|
|
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
|
|
// ^
|
|
// [cfe] A value of type 'String' can't be assigned to a variable of type 'int'.
|
|
}
|
|
|
|
main() {
|
|
f(A(), 0);
|
|
}
|