blob: 4e8196ea9b9c8666f2b2e9812f4e580c3952acfc [file] [log] [blame]
/*
* Copyright (c) 2011, 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.
*/
/**
* @assertion It is a compile error if the return type of the user-declared
* operator []= is explicitly declared and not void.
* @description Checks that it is a static warning if the return type of
* the user-declared operator []= is not void.
* @author msyabro
* @author sgrekhov@unipro.ru
* @issue 42198
*/
class C {
int operator []=(index, value) => 42;
//^^^
// [analyzer] unspecified
// [cfe] unspecified
operator[](index) {}
}
main() {
C c = new C();
c[0] = new C();
}