blob: 6d104d0c2d45255f3ce2d07e08df9e7bb76a55f2 [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 a factory returns a non-null object whose
* type is not a subtype of its actual return type.
* @description Checks that returning an object whose type is not subtype of M
* from factory M.id produces a compile error.
* @compile-error
* @author kaigorodov
*/
abstract class I {}
class C implements I {}
class A implements I {
factory A.foo() { return new C(); }
}
main() {
new A.foo();
}