Handle mis-included parts differently

If, for instance, including something that is not a part of the file
you include it from, previously we would copy things over anyway, and
other libraries wouldn't be able to use it
(for instance including it would fail).

Now, instead, we don't include it, structurally pretending the "part of"
line wasn't there (that is, we don't copy things over and other libraries
are free to include it).

As before, an error is given, but errors doesn't 'cascade' into other
libraries that (before this change) couldn't use the included file.

Change-Id: Ica6225c437ea7dd66f9e8955e638f442b2df8f97
Reviewed-on: https://dart-review.googlesource.com/c/90380
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
Jens Johansen 2019-01-28 14:20:45 +00:00 committed by commit-bot@chromium.org
parent f066c05319
commit 5cf4e543b8
36 changed files with 669 additions and 15 deletions

View file

@ -1329,8 +1329,9 @@ class KernelLibraryBuilder
}
@override
void includePart(covariant KernelLibraryBuilder part, Set<Uri> usedParts) {
super.includePart(part, usedParts);
void includePart(
covariant KernelLibraryBuilder part, Set<Uri> usedParts, int partOffset) {
super.includePart(part, usedParts, partOffset);
nativeMethods.addAll(part.nativeMethods);
boundlessTypeVariables.addAll(part.boundlessTypeVariables);
// Check that the targets are different. This is not normally a problem

View file

@ -805,6 +805,7 @@ class KernelTarget extends TargetImplementation {
KernelLibraryBuilder part = library.loader.read(patch, -1,
origin: library, fileUri: patch, accessor: library);
first.parts.add(part);
first.partOffsets.add(-1);
part.partOfUri = first.uri;
}
}

View file

@ -669,7 +669,9 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
void includeParts(Set<Uri> usedParts) {
Set<Uri> seenParts = new Set<Uri>();
for (SourceLibraryBuilder<T, R> part in parts) {
for (int i = 0; i < parts.length; i++) {
SourceLibraryBuilder<T, R> part = parts[i];
int partOffset = partOffsets[i];
if (part == this) {
addProblem(messagePartOfSelf, -1, noLength, fileUri);
} else if (seenParts.add(part.fileUri)) {
@ -687,7 +689,7 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
} else {
usedParts.add(part.uri);
}
includePart(part, usedParts);
includePart(part, usedParts, partOffset);
}
} else {
addProblem(templatePartTwice.withArguments(part.fileUri), -1, noLength,
@ -696,45 +698,53 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
}
}
void includePart(SourceLibraryBuilder<T, R> part, Set<Uri> usedParts) {
void includePart(
SourceLibraryBuilder<T, R> part, Set<Uri> usedParts, int partOffset) {
if (part.partOfUri != null) {
if (uriIsValid(part.partOfUri) && part.partOfUri != uri) {
// This is a warning, but the part is still included.
// This is an error, but the part is not removed from the list of parts,
// so that metadata annotations can be associated with it.
addProblem(
templatePartOfUriMismatch.withArguments(
part.fileUri, uri, part.partOfUri),
-1,
partOffset,
noLength,
fileUri);
return;
}
} else if (part.partOfName != null) {
if (name != null) {
if (part.partOfName != name) {
// This is a warning, but the part is still included.
// This is an error, but the part is not removed from the list of
// parts, so that metadata annotations can be associated with it.
addProblem(
templatePartOfLibraryNameMismatch.withArguments(
part.fileUri, name, part.partOfName),
-1,
partOffset,
noLength,
fileUri);
return;
}
} else {
// This is a warning, but the part is still included.
// This is an error, but the part is not removed from the list of parts,
// so that metadata annotations can be associated with it.
addProblem(
templatePartOfUseUri.withArguments(
part.fileUri, fileUri, part.partOfName),
-1,
partOffset,
noLength,
fileUri);
return;
}
} else {
// This is an error, but the part is still included, so that
// metadata annotations can be associated with it.
// This is an error, but the part is not removed from the list of parts,
// so that metadata annotations can be associated with it.
assert(!part.isPart);
if (uriIsValid(part.fileUri)) {
addProblem(templateMissingPartOf.withArguments(part.fileUri), -1,
noLength, fileUri);
addProblem(templateMissingPartOf.withArguments(part.fileUri),
partOffset, noLength, fileUri);
}
return;
}
part.validatePart(this, usedParts);
NameIterator partDeclarations = part.nameIterator;

View file

@ -0,0 +1,10 @@
// Copyright (c) 2019, 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.
import 'part_not_part_of_lib2.dart';
@override
part 'part_not_part_of_lib1.dart';
main() {}

View file

@ -0,0 +1,31 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of.dart:8:6: Error: Can't use 'pkg/front_end/testcases/part_not_part_of_lib1.dart' as a part, because it has no 'part of' declaration.
// part 'part_not_part_of_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_lib2.dart";
@core::override
part part_not_part_of_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
import "./part_not_part_of_lib1.dart" as par;
import "org-dartlang-testcase:///part_not_part_of_lib1.dart";
static method methodFromLib2() → dynamic {
par::methodFromLib1();
}
library;
import self as par;
static method methodFromLib1() → dynamic {}

View file

@ -0,0 +1,31 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of.dart:8:6: Error: Can't use 'pkg/front_end/testcases/part_not_part_of_lib1.dart' as a part, because it has no 'part of' declaration.
// part 'part_not_part_of_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_lib2.dart";
@core::override
part part_not_part_of_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
import "./part_not_part_of_lib1.dart" as par;
import "org-dartlang-testcase:///part_not_part_of_lib1.dart";
static method methodFromLib2() → dynamic {
par::methodFromLib1();
}
library;
import self as par;
static method methodFromLib1() → dynamic {}

View file

@ -0,0 +1,29 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of.dart:8:6: Error: Can't use 'pkg/front_end/testcases/part_not_part_of_lib1.dart' as a part, because it has no 'part of' declaration.
// part 'part_not_part_of_lib1.dart';
// ^
//
import self as self;
import "org-dartlang-testcase:///part_not_part_of_lib2.dart";
part part_not_part_of_lib1.dart;
static method main() → dynamic
;
library;
import self as self2;
import "org-dartlang-testcase:///part_not_part_of_lib1.dart";
static method methodFromLib2() → dynamic
;
library;
import self as self3;
static method methodFromLib1() → dynamic
;

View file

@ -0,0 +1,31 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of.dart:8:6: Error: Can't use 'pkg/front_end/testcases/part_not_part_of_lib1.dart' as a part, because it has no 'part of' declaration.
// part 'part_not_part_of_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_lib2.dart";
@core::override
part part_not_part_of_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
import "./part_not_part_of_lib1.dart" as par;
import "org-dartlang-testcase:///part_not_part_of_lib1.dart";
static method methodFromLib2() → dynamic {
par::methodFromLib1();
}
library;
import self as par;
static method methodFromLib1() → dynamic {}

View file

@ -0,0 +1,31 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of.dart:8:6: Error: Can't use 'pkg/front_end/testcases/part_not_part_of_lib1.dart' as a part, because it has no 'part of' declaration.
// part 'part_not_part_of_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_lib2.dart";
@core::override
part part_not_part_of_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
import "./part_not_part_of_lib1.dart" as par;
import "org-dartlang-testcase:///part_not_part_of_lib1.dart";
static method methodFromLib2() → dynamic {
par::methodFromLib1();
}
library;
import self as par;
static method methodFromLib1() → dynamic {}

View file

@ -0,0 +1,5 @@
// Copyright (c) 2019, 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.
methodFromLib1() {}

View file

@ -0,0 +1,9 @@
// Copyright (c) 2019, 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.
import "part_not_part_of_lib1.dart";
methodFromLib2() {
methodFromLib1();
}

View file

@ -0,0 +1,10 @@
// Copyright (c) 2019, 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.
import 'part_not_part_of_same_named_library_lib2.dart';
@override
part 'part_not_part_of_same_named_library_lib1.dart';
main() {}

View file

@ -0,0 +1,26 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of_same_named_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_not_part_of_same_named_library_lib1.dart' as part of 'pkg/front_end/testcases/part_not_part_of_same_named_library.dart' but its 'part of' declaration says 'foo'.
// Try changing the 'part of' declaration to use a relative file name.
// part 'part_not_part_of_same_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_same_named_library_lib2.dart";
@core::override
part part_not_part_of_same_named_library_lib1.dart;
static method main() → dynamic {}
library foo;
import self as self2;
part part_not_part_of_same_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_not_part_of_same_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,26 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of_same_named_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_not_part_of_same_named_library_lib1.dart' as part of 'pkg/front_end/testcases/part_not_part_of_same_named_library.dart' but its 'part of' declaration says 'foo'.
// Try changing the 'part of' declaration to use a relative file name.
// part 'part_not_part_of_same_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_same_named_library_lib2.dart";
@core::override
part part_not_part_of_same_named_library_lib1.dart;
static method main() → dynamic {}
library foo;
import self as self2;
part part_not_part_of_same_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_not_part_of_same_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,25 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of_same_named_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_not_part_of_same_named_library_lib1.dart' as part of 'pkg/front_end/testcases/part_not_part_of_same_named_library.dart' but its 'part of' declaration says 'foo'.
// Try changing the 'part of' declaration to use a relative file name.
// part 'part_not_part_of_same_named_library_lib1.dart';
// ^
//
import self as self;
import "org-dartlang-testcase:///part_not_part_of_same_named_library_lib2.dart";
part part_not_part_of_same_named_library_lib1.dart;
static method main() → dynamic
;
library foo;
import self as self2;
part part_not_part_of_same_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_not_part_of_same_named_library_lib1.dart */ methodFromLib1() → dynamic
;
static method methodFromLib2() → dynamic
;

View file

@ -0,0 +1,26 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of_same_named_library.dart:8:6: Error: Using 'pkg/front_end/testcases/part_not_part_of_same_named_library_lib1.dart' as part of 'pkg/front_end/testcases/part_not_part_of_same_named_library.dart' but its 'part of' declaration says 'foo'.
// Try changing the 'part of' declaration to use a relative file name.
// part 'part_not_part_of_same_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_same_named_library_lib2.dart";
@core::override
part part_not_part_of_same_named_library_lib1.dart;
static method main() → dynamic {}
library foo;
import self as self2;
part part_not_part_of_same_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_not_part_of_same_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,26 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_not_part_of_same_named_library.dart:8:6: Error: Using 'pkg/front_end/testcases/part_not_part_of_same_named_library_lib1.dart' as part of 'pkg/front_end/testcases/part_not_part_of_same_named_library.dart' but its 'part of' declaration says 'foo'.
// Try changing the 'part of' declaration to use a relative file name.
// part 'part_not_part_of_same_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_not_part_of_same_named_library_lib2.dart";
@core::override
part part_not_part_of_same_named_library_lib1.dart;
static method main() → dynamic {}
library foo;
import self as self2;
part part_not_part_of_same_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_not_part_of_same_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,7 @@
// Copyright (c) 2019, 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.
part of foo;
methodFromLib1() {}

View file

@ -0,0 +1,11 @@
// Copyright (c) 2019, 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.
library foo;
part "part_not_part_of_same_named_library_lib1.dart";
methodFromLib2() {
methodFromLib1();
}

View file

@ -0,0 +1,10 @@
// Copyright (c) 2019, 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.
import 'part_part_of_different_unnamed_library_lib2.dart';
@override
part 'part_part_of_different_unnamed_library_lib1.dart';
main() {}

View file

@ -0,0 +1,25 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_different_unnamed_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib1.dart' as part of 'pkg/front_end/testcases/part_part_of_different_unnamed_library.dart' but its 'part of' declaration says 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib2.dart'.
// part 'part_part_of_different_unnamed_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_different_unnamed_library_lib2.dart";
@core::override
part part_part_of_different_unnamed_library_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
part part_part_of_different_unnamed_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_different_unnamed_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,25 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_different_unnamed_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib1.dart' as part of 'pkg/front_end/testcases/part_part_of_different_unnamed_library.dart' but its 'part of' declaration says 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib2.dart'.
// part 'part_part_of_different_unnamed_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_different_unnamed_library_lib2.dart";
@core::override
part part_part_of_different_unnamed_library_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
part part_part_of_different_unnamed_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_different_unnamed_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,24 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_different_unnamed_library.dart:8:6: Warning: Using 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib1.dart' as part of 'pkg/front_end/testcases/part_part_of_different_unnamed_library.dart' but its 'part of' declaration says 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib2.dart'.
// part 'part_part_of_different_unnamed_library_lib1.dart';
// ^
//
import self as self;
import "org-dartlang-testcase:///part_part_of_different_unnamed_library_lib2.dart";
part part_part_of_different_unnamed_library_lib1.dart;
static method main() → dynamic
;
library;
import self as self2;
part part_part_of_different_unnamed_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_different_unnamed_library_lib1.dart */ methodFromLib1() → dynamic
;
static method methodFromLib2() → dynamic
;

View file

@ -0,0 +1,25 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_different_unnamed_library.dart:8:6: Error: Using 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib1.dart' as part of 'pkg/front_end/testcases/part_part_of_different_unnamed_library.dart' but its 'part of' declaration says 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib2.dart'.
// part 'part_part_of_different_unnamed_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_different_unnamed_library_lib2.dart";
@core::override
part part_part_of_different_unnamed_library_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
part part_part_of_different_unnamed_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_different_unnamed_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,25 @@
library;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_different_unnamed_library.dart:8:6: Error: Using 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib1.dart' as part of 'pkg/front_end/testcases/part_part_of_different_unnamed_library.dart' but its 'part of' declaration says 'pkg/front_end/testcases/part_part_of_different_unnamed_library_lib2.dart'.
// part 'part_part_of_different_unnamed_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_different_unnamed_library_lib2.dart";
@core::override
part part_part_of_different_unnamed_library_lib1.dart;
static method main() → dynamic {}
library;
import self as self2;
part part_part_of_different_unnamed_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_different_unnamed_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,7 @@
// Copyright (c) 2019, 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.
part of "part_part_of_different_unnamed_library_lib2.dart";
methodFromLib1() {}

View file

@ -0,0 +1,9 @@
// Copyright (c) 2019, 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.
part "part_part_of_different_unnamed_library_lib1.dart";
methodFromLib2() {
methodFromLib1();
}

View file

@ -0,0 +1,12 @@
// Copyright (c) 2019, 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.
library foo;
import 'part_part_of_differently_named_library_lib2.dart';
@override
part 'part_part_of_differently_named_library_lib1.dart';
main() {}

View file

@ -0,0 +1,25 @@
library foo;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_differently_named_library.dart:10:6: Warning: Using 'pkg/front_end/testcases/part_part_of_differently_named_library_lib1.dart' as part of 'foo' but its 'part of' declaration says 'bar'.
// part 'part_part_of_differently_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_differently_named_library_lib2.dart";
@core::override
part part_part_of_differently_named_library_lib1.dart;
static method main() → dynamic {}
library bar;
import self as self2;
part part_part_of_differently_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_differently_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,25 @@
library foo;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_differently_named_library.dart:10:6: Warning: Using 'pkg/front_end/testcases/part_part_of_differently_named_library_lib1.dart' as part of 'foo' but its 'part of' declaration says 'bar'.
// part 'part_part_of_differently_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_differently_named_library_lib2.dart";
@core::override
part part_part_of_differently_named_library_lib1.dart;
static method main() → dynamic {}
library bar;
import self as self2;
part part_part_of_differently_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_differently_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,24 @@
library foo;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_differently_named_library.dart:10:6: Warning: Using 'pkg/front_end/testcases/part_part_of_differently_named_library_lib1.dart' as part of 'foo' but its 'part of' declaration says 'bar'.
// part 'part_part_of_differently_named_library_lib1.dart';
// ^
//
import self as self;
import "org-dartlang-testcase:///part_part_of_differently_named_library_lib2.dart";
part part_part_of_differently_named_library_lib1.dart;
static method main() → dynamic
;
library bar;
import self as self2;
part part_part_of_differently_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_differently_named_library_lib1.dart */ methodFromLib1() → dynamic
;
static method methodFromLib2() → dynamic
;

View file

@ -0,0 +1,25 @@
library foo;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_differently_named_library.dart:10:6: Error: Using 'pkg/front_end/testcases/part_part_of_differently_named_library_lib1.dart' as part of 'foo' but its 'part of' declaration says 'bar'.
// part 'part_part_of_differently_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_differently_named_library_lib2.dart";
@core::override
part part_part_of_differently_named_library_lib1.dart;
static method main() → dynamic {}
library bar;
import self as self2;
part part_part_of_differently_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_differently_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,25 @@
library foo;
//
// Problems in library:
//
// pkg/front_end/testcases/part_part_of_differently_named_library.dart:10:6: Error: Using 'pkg/front_end/testcases/part_part_of_differently_named_library_lib1.dart' as part of 'foo' but its 'part of' declaration says 'bar'.
// part 'part_part_of_differently_named_library_lib1.dart';
// ^
//
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///part_part_of_differently_named_library_lib2.dart";
@core::override
part part_part_of_differently_named_library_lib1.dart;
static method main() → dynamic {}
library bar;
import self as self2;
part part_part_of_differently_named_library_lib1.dart;
static method /* from org-dartlang-testcase:///part_part_of_differently_named_library_lib1.dart */ methodFromLib1() → dynamic {}
static method methodFromLib2() → dynamic {
self2::methodFromLib1();
}

View file

@ -0,0 +1,7 @@
// Copyright (c) 2019, 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.
part of bar;
methodFromLib1() {}

View file

@ -0,0 +1,11 @@
// Copyright (c) 2019, 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.
library bar;
part "part_part_of_differently_named_library_lib1.dart";
methodFromLib2() {
methodFromLib1();
}

View file

@ -724,6 +724,10 @@ override_check_with_covariant_modifier: TypeCheckError # Issue #31620
override: TextSerializationFailure # Was: Pass
part_as_entry_point_lib: TextSerializationFailure # Was: Pass
part_as_entry_point: TextSerializationFailure # Was: Pass
part_not_part_of: TextSerializationFailure
part_not_part_of_same_named_library: TextSerializationFailure
part_part_of_different_unnamed_library: TextSerializationFailure
part_part_of_differently_named_library: TextSerializationFailure
prefer_baseclass: TextSerializationFailure # Was: Pass
private_method_tearoff_lib: TextSerializationFailure # Was: Pass
private_method_tearoff: TextSerializationFailure # Was: Pass