mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:33:28 +00:00
Add frontend testcases for part with part(s) in it
Currently there's at least two issues: * We can crash * We can add metadata to things they weren't meant for Change-Id: I4e277ea614ce9faa25b2bf1c5a16a5e877df225b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106640 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
parent
16eee4a141
commit
a878514cf5
|
@ -0,0 +1,8 @@
|
|||
@Foo
|
||||
part 'having_part_with_part_and_annotation_lib1.dart';
|
||||
|
||||
const int Foo = 42;
|
||||
|
||||
void fromMain() {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,21 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::Foo
|
||||
@self::Bar
|
||||
part having_part_with_part_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void {}
|
||||
static method main() → dynamic {}
|
||||
static method /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */ fromLib1() → void {}
|
|
@ -0,0 +1,21 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::Foo
|
||||
@self::Bar
|
||||
part having_part_with_part_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void {}
|
||||
static method main() → dynamic {}
|
||||
static method /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */ fromLib1() → void {}
|
|
@ -0,0 +1,22 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
part having_part_with_part_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */ fromLib1() → void
|
||||
;
|
|
@ -0,0 +1,21 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::Foo
|
||||
@self::Bar
|
||||
part having_part_with_part_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void {}
|
||||
static method main() → dynamic {}
|
||||
static method /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */ fromLib1() → void {}
|
|
@ -0,0 +1,21 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_part_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
@self::Foo
|
||||
@self::Bar
|
||||
part having_part_with_part_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void {}
|
||||
static method main() → dynamic {}
|
||||
static method /* from org-dartlang-testcase:///having_part_with_part_and_annotation_lib1.dart */ fromLib1() → void {}
|
|
@ -0,0 +1,8 @@
|
|||
part of 'having_part_with_part_and_annotation.dart';
|
||||
|
||||
@Bar
|
||||
part 'having_part_with_part_and_annotation_lib2.dart';
|
||||
|
||||
const int Bar = 43;
|
||||
|
||||
void fromLib1() {}
|
|
@ -0,0 +1,3 @@
|
|||
part of 'having_part_with_part_and_annotation_lib1.dart';
|
||||
|
||||
void fromLib2() {}
|
|
@ -0,0 +1,8 @@
|
|||
@Foo
|
||||
part 'having_part_with_parts_and_annotation_lib1.dart';
|
||||
|
||||
const int Foo = 42;
|
||||
|
||||
void fromMain() {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,29 @@
|
|||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_parts_and_annotation_lib1.dart:4:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_parts_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_parts_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
// pkg/front_end/testcases/having_part_with_parts_and_annotation_lib1.dart:6:6: Error: A file that's a part of a library can't have parts itself.
|
||||
// Try moving the 'part' declaration to the containing library.
|
||||
// part 'having_part_with_parts_and_annotation_lib2.dart';
|
||||
// ^
|
||||
// pkg/front_end/testcases/having_part_with_parts_and_annotation.dart: Context: This is the containing library.
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
part having_part_with_parts_and_annotation_lib1.dart;
|
||||
static const field core::int Foo = 42;
|
||||
static const field core::int Bar = 43 /* from org-dartlang-testcase:///having_part_with_parts_and_annotation_lib1.dart */;
|
||||
static const field core::int Baz = 44 /* from org-dartlang-testcase:///having_part_with_parts_and_annotation_lib1.dart */;
|
||||
static method fromMain() → void
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
||||
static method /* from org-dartlang-testcase:///having_part_with_parts_and_annotation_lib1.dart */ fromLib1() → void
|
||||
;
|
|
@ -0,0 +1,11 @@
|
|||
part of 'having_part_with_parts_and_annotation.dart';
|
||||
|
||||
@Bar
|
||||
part 'having_part_with_parts_and_annotation_lib2.dart';
|
||||
@Baz
|
||||
part 'having_part_with_parts_and_annotation_lib2.dart';
|
||||
|
||||
const int Bar = 43;
|
||||
const int Baz = 44;
|
||||
|
||||
void fromLib1() {}
|
|
@ -0,0 +1,3 @@
|
|||
part of 'having_part_with_parts_and_annotation_lib1.dart';
|
||||
|
||||
void fromLib2() {}
|
|
@ -16,6 +16,7 @@ duplicated_field_initializer: RuntimeError
|
|||
external_import: RuntimeError # Expected -- test uses import which doesn't exist.
|
||||
fallthrough: Fail # Missing FallThroughError.
|
||||
function_type_recovery: Fail
|
||||
having_part_with_parts_and_annotation: Crash
|
||||
incomplete_field_formal_parameter: Fail # Fasta doesn't recover well
|
||||
inference/bug31436: RuntimeError # Test exercises Dart 2.0 semantics
|
||||
inference/constructors_too_many_positional_arguments: Fail
|
||||
|
|
|
@ -24,6 +24,7 @@ dynamic_and_void: InstrumentationMismatch # Test assumes Dart 1.0 semantics
|
|||
expressions: RuntimeError
|
||||
external_import: RuntimeError # The native extension to import doesn't exist. This is ok.
|
||||
fallthrough: ExpectationFileMismatch
|
||||
having_part_with_parts_and_annotation: Crash
|
||||
incomplete_field_formal_parameter: RuntimeError
|
||||
inference/abstract_class_instantiation: InstrumentationMismatch # Issue #30040
|
||||
inference/conflicting_fields: TypeCheckError
|
||||
|
|
|
@ -104,6 +104,8 @@ function_type_recovery: TextSerializationFailure # Was: Pass
|
|||
functions: TextSerializationFailure # Was: Pass
|
||||
future_or_test: TextSerializationFailure # Was: Pass
|
||||
hello: TextSerializationFailure # Was: Pass
|
||||
having_part_with_part_and_annotation: TextSerializationFailure
|
||||
having_part_with_parts_and_annotation: Crash
|
||||
illegal_named_function_expression: TextSerializationFailure # Was: Pass
|
||||
illegal_named_function_expression_scope: TextSerializationFailure # Was: Pass
|
||||
implicit_const_with_static_fields: TextSerializationFailure # Was: Pass
|
||||
|
|
Loading…
Reference in a new issue