mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
[cfe] Add test for unused cyclic redirecting factories
Closes #46334 Change-Id: Iaec6a958e1850aacec21617be76062c200360f21 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211261 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
3be0f377a5
commit
7959f037bd
9
pkg/front_end/testcases/general/issue46334.dart
Normal file
9
pkg/front_end/testcases/general/issue46334.dart
Normal file
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) 2021, 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.
|
||||
|
||||
class C {
|
||||
factory C() = C;
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,5 @@
|
|||
class C {
|
||||
factory C() = C;
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,5 @@
|
|||
class C {
|
||||
factory C() = C;
|
||||
}
|
||||
|
||||
main() {}
|
19
pkg/front_end/testcases/general/issue46334.dart.weak.expect
Normal file
19
pkg/front_end/testcases/general/issue46334.dart.weak.expect
Normal file
|
@ -0,0 +1,19 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
// factory C() = C;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C extends core::Object {
|
||||
static final field dynamic _redirecting# = <dynamic>[self::C::•]/*isLegacy*/;
|
||||
static factory •() → self::C
|
||||
return invalid-expression "pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
factory C() = C;
|
||||
^";
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,20 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
// factory C() = C;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C extends core::Object {
|
||||
static final field dynamic _redirecting# = <dynamic>[self::C::•]/*isLegacy*/;
|
||||
static factory •() → self::C
|
||||
return invalid-expression "pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
factory C() = C;
|
||||
^";
|
||||
}
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,19 @@
|
|||
library /*isNonNullableByDefault*/;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
// factory C() = C;
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C extends core::Object {
|
||||
static final field dynamic _redirecting# = <dynamic>[self::C::•]/*isLegacy*/;
|
||||
static factory •() → self::C
|
||||
return invalid-expression "pkg/front_end/testcases/general/issue46334.dart:6:11: Error: Cyclic definition of factory 'C'.
|
||||
factory C() = C;
|
||||
^";
|
||||
}
|
||||
static method main() → dynamic {}
|
Loading…
Reference in a new issue