blob: de18887240d1eff1f900929a8167f13a170e0ca0 [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 Let f be the function immediately enclosing a return statement of
* the form return; It is a static warning f is neither a generator nor a
* generative constructor and either:
* • f is synchronous and the return type of f may not be assigned to void or,
* • f is asynchronous and the return type of f may not be assigned to
* Future<Null>.
*
* @description Checks that a static warning occurs if a statement of the form
* "return;" is used in a getter method whose declared return type is bool.
*
* @static-warning
* @author vasya
* @reviewer rodionov
* @reviewer iefremov
*/
class C {
C() { }
bool get foo {
return; /// static type warning
}
}
main() {
bool x = new C().foo;
}