98a9adf696
Prior to this CL the return type of any constructor function was always void. According to the specification §9.3 the return type of a constructor function ought to be its enclosing class. Change-Id: I70d76cc354b7f118ce96bf4954daf7fe535eb7be Reviewed-on: https://dart-review.googlesource.com/76160 Commit-Queue: Daniel Hillerström <hillerstrom@google.com> Reviewed-by: Peter von der Ahé <ahe@google.com>
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
// Formatted problems:
|
|
//
|
|
// pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
|
|
// Try to have all constructors eventually redirect to a non-redirecting constructor.
|
|
// A.bar() : this.foo();
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
|
|
// Try to have all constructors eventually redirect to a non-redirecting constructor.
|
|
// A() : this();
|
|
// ^^^^
|
|
|
|
// Unhandled errors:
|
|
//
|
|
// pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
|
|
// Try to have all constructors eventually redirect to a non-redirecting constructor.
|
|
// A.bar() : this.foo();
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
|
|
// Try to have all constructors eventually redirect to a non-redirecting constructor.
|
|
// A() : this();
|
|
// ^^^^
|
|
|
|
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
constructor foo() → self::A
|
|
: this self::A::bar()
|
|
;
|
|
constructor bar() → self::A
|
|
: this self::A::foo()
|
|
;
|
|
constructor baz() → self::A
|
|
: this self::A::foo()
|
|
;
|
|
constructor •() → self::A
|
|
: this self::A::•()
|
|
;
|
|
}
|
|
static method main() → dynamic {}
|