diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t01.dart b/Language/Libraries_and_Scripts/Parts/compilation_t01.dart index b0798673d7..979568ed0f 100644 --- a/Language/Libraries_and_Scripts/Parts/compilation_t01.dart +++ b/Language/Libraries_and_Scripts/Parts/compilation_t01.dart @@ -2,18 +2,16 @@ // 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. +/// @assertion Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// /// @description Checks that it is a compile-time error when names in the /// included file conflict with top-level definitions in this library. /// @author rodionov -/// @issue 44990 -library Parts_test_lib; -part "part_0.dart"; +part "compilation_t01_part.dart"; var foo; diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t01_part.dart b/Language/Libraries_and_Scripts/Parts/compilation_t01_part.dart new file mode 100644 index 0000000000..58bc1ce31c --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/compilation_t01_part.dart @@ -0,0 +1,25 @@ +// 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 Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// +/// @description Checks that it is a compile-time error when names in the +/// included file conflict with top-level definitions in this library. +/// @author rodionov + +@Annot() +part of "compilation_t01.dart"; + +class Annot { + const Annot(); +} + +final foo = "foo"; +// ^^^ +// [analyzer] unspecified +// [cfe] unspecified +var bar = 1; diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t02.dart b/Language/Libraries_and_Scripts/Parts/compilation_t02.dart deleted file mode 100644 index 06bda57b5d..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t02.dart +++ /dev/null @@ -1,23 +0,0 @@ -// 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 static warning if the referenced part declaration p names -/// a library other than the current library as the library to which p belongs. -/// @description Checks that it is a static warning if the referenced part names -/// another library, but not a compile-time error and all definitions from such -/// part are available without errors. -/// @description Checks that it is a compile-time error if there're two part -/// directives referencing the same URI. -/// @author rodionov -/// @issue 46998 - -library Parts_test_lib; -part "part_2.dart"; -part "part_2.dart"; -// ^ -// [analyzer] unspecified - -main() { - foo is int; -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t03.dart b/Language/Libraries_and_Scripts/Parts/compilation_t03.dart index 01a0820635..671e3d48ef 100644 --- a/Language/Libraries_and_Scripts/Parts/compilation_t03.dart +++ b/Language/Libraries_and_Scripts/Parts/compilation_t03.dart @@ -2,19 +2,18 @@ // 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. +/// @assertion Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// /// @description Checks that the top level declarations at URI are compiled in /// the scope of the current library (including private declarations). /// @Issue 42393 /// @author rodionov -library Parts_test_lib; import "../../../Utils/expect.dart"; -part "part_2.dart"; +part "compilation_t03_part.dart"; main() { //functions diff --git a/Language/Libraries_and_Scripts/Parts/part_2.dart b/Language/Libraries_and_Scripts/Parts/compilation_t03_part.dart similarity index 66% rename from Language/Libraries_and_Scripts/Parts/part_2.dart rename to Language/Libraries_and_Scripts/Parts/compilation_t03_part.dart index 534ddee7cb..070ad530ce 100644 --- a/Language/Libraries_and_Scripts/Parts/part_2.dart +++ b/Language/Libraries_and_Scripts/Parts/compilation_t03_part.dart @@ -2,7 +2,15 @@ // 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 Parts_test_lib; +/// @assertion Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// +/// @description Checks that the top level declarations at URI are compiled in +/// the scope of the current library (including private declarations). + +part of 'compilation_t03.dart'; foo() { return null; } int bar(int x, int y) { return x + y ; } @@ -15,7 +23,6 @@ get value { return _value; } set value(value) { _value = value; } var _value; - final int i = -100; final bool b = false; final String s = "string"; diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t04.dart b/Language/Libraries_and_Scripts/Parts/compilation_t04.dart index feca0fa0d4..ab3e2ea335 100644 --- a/Language/Libraries_and_Scripts/Parts/compilation_t04.dart +++ b/Language/Libraries_and_Scripts/Parts/compilation_t04.dart @@ -2,20 +2,18 @@ // 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. +/// @assertion Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. /// /// @description Checks that more than one part can be included in a library /// without errors as long as there are no name conflicts. /// @author rodionov -library Parts_test_lib; import "../../../Utils/expect.dart"; -part "part_3.dart"; -part "part_12.dart"; +part "compilation_t04_part1.dart"; +part "compilation_t04_part2.dart"; main() { // get/set diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t04_part1.dart b/Language/Libraries_and_Scripts/Parts/compilation_t04_part1.dart new file mode 100644 index 0000000000..7bb6595468 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/compilation_t04_part1.dart @@ -0,0 +1,19 @@ +// 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 Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// +/// @description Checks that more than one part can be included in a library +/// without errors as long as there are no name conflicts. + +part of 'compilation_t04.dart'; + +class A { } + +get value { return _value; } +set value(value) { _value = value; } +var _value; diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t04_part2.dart b/Language/Libraries_and_Scripts/Parts/compilation_t04_part2.dart new file mode 100644 index 0000000000..19504f9f1c --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/compilation_t04_part2.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2024, 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 Compiling a part directive of the form `part s;` causes the Dart +/// system to attempt to compile the contents of the URI that is the value of +/// `s`. The top-level declarations at that URI are then compiled by the Dart +/// compiler in the scope of the current library. +/// +/// @description Checks that more than one part can be included in a library +/// without errors as long as there are no name conflicts. + +@Annot() +part of 'compilation_t04.dart'; + +class Annot { + const Annot(); +} + +final foo = "foo"; +var bar = 1; diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t05.dart b/Language/Libraries_and_Scripts/Parts/compilation_t05.dart deleted file mode 100644 index b10be7476b..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t05.dart +++ /dev/null @@ -1,60 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that including a compilation unit with valid -/// topLevelDefinitions does not cause any compile-time errors. -/// @Issue 42393 -/// @author rodionov - -library Parts_test_lib; -import "../../../Utils/expect.dart"; -part "part_2.dart"; - -main() { - Expect.equals(null, foo()); - - Expect.equals(3, bar(1,2)); - Expect.equals(13, bar(7,6)); - Expect.equals(33, bar(11,22)); - - Expect.listEquals([], list(0)); - Expect.listEquals(new List.filled(101, 0), list(101)); - Expect.listEquals(new List.filled(1000, 0), list(1000)); - - //function alias - func ff = (bool b, [String? s]) => ""; - - // get/set - value = 1; - Expect.equals(1, value); - value = false; - Expect.equals(false, value); - value = "foo"; - Expect.equals("foo", value); - value = foo(); - Expect.equals(null, value); - value = [1,2,3,4]; - Expect.listEquals([1,2,3,4], value); - - // variables - Expect.equals(-100, i); - Expect.equals(false, b); - Expect.equals("string", s); - Expect.equals(const [0,1,2,3], l); - Expect.equals(const {'a': 1, 'b': 2}, m); - Expect.equals("OneTwo", e); - - // class - A a = new A(); - Expect.equals("A.FOO", A.FOO); - Expect.equals("a.foo()", a.foo()); - Expect.equals("a.bar", a.bar); - a.value = "a.value"; - Expect.equals("a.value", a.value); -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t06.dart b/Language/Libraries_and_Scripts/Parts/compilation_t06.dart deleted file mode 100644 index 052ae9ddd8..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t06.dart +++ /dev/null @@ -1,20 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error if the contents of -/// the URI are not a valid part declaration (syntax error in a top-level -/// declaration). -/// @author rodionov -/// @issue 44990 - -library Parts_test_lib; -part "part_8.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t07.dart b/Language/Libraries_and_Scripts/Parts/compilation_t07.dart deleted file mode 100644 index f35672fe58..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t07.dart +++ /dev/null @@ -1,25 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error when the included -/// compilation unit contains a library definition instead of a part declaration. -/// @author rodionov - -library Parts_test_lib; -part "part_9_lib.dart"; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -main() { - var x = foo; -// ^ -// [analyzer] unspecified -// [cfe] unspecified -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t08.dart b/Language/Libraries_and_Scripts/Parts/compilation_t08.dart deleted file mode 100644 index 92d7902593..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t08.dart +++ /dev/null @@ -1,19 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error when the included -/// compilation unit contains another part directive. -/// @author rodionov -/// @issue 44990 - -library Parts_test_lib; -part "part_1.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t09.dart b/Language/Libraries_and_Scripts/Parts/compilation_t09.dart deleted file mode 100644 index dbab6b2185..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t09.dart +++ /dev/null @@ -1,22 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error when this library -/// references itself in a part directive (and doesn't contain a part -/// declaration). -/// @author rodionov - - -library Parts_test_lib; -part "compilation_t09.dart"; -// ^ -// [analyzer] unspecified - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t10.dart b/Language/Libraries_and_Scripts/Parts/compilation_t10.dart deleted file mode 100644 index fac0b1f0b0..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t10.dart +++ /dev/null @@ -1,24 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error when this library -/// references itself in a part directive (and contains a part declaration). -/// @author rodionov - -// [error line 1, column 1] -// [cfe] unspecified - -library Parts_test_lib; -part of Parts_test_lib; -//^ -// [analyzer] unspecified -part "part_3.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t11.dart b/Language/Libraries_and_Scripts/Parts/compilation_t11.dart deleted file mode 100644 index 49a20bbbf5..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t11.dart +++ /dev/null @@ -1,21 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error when the included part -/// unit contains an import declaration. -/// @author rodionov -/// @issue 44990, 54661 - -part "part_9.dart"; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t12.dart b/Language/Libraries_and_Scripts/Parts/compilation_t12.dart deleted file mode 100644 index dba2ee6c66..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t12.dart +++ /dev/null @@ -1,19 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error if the contents of the -/// URI are not a valid part declaration (missing semicolon in the part header). -/// @author rodionov -/// @issue 44990 - -library Parts_test_lib; -part "part_4.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t13.dart b/Language/Libraries_and_Scripts/Parts/compilation_t13.dart deleted file mode 100644 index c0699092c1..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t13.dart +++ /dev/null @@ -1,19 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error if the included part -/// contains a statement where a top-level definition is expected. -/// @author rodionov -/// @issue 44990 - -library Parts_test_lib; -part "part_6.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t14.dart b/Language/Libraries_and_Scripts/Parts/compilation_t14.dart deleted file mode 100644 index eafbd02546..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t14.dart +++ /dev/null @@ -1,19 +0,0 @@ -// 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// @description Checks that it is a compile-time error if the included part -/// contains an expression where a top-level definition is expected. -/// @author rodionov -/// @issue 44990 - -library Parts_test_lib; -part "part_7.dart"; - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t15.dart b/Language/Libraries_and_Scripts/Parts/compilation_t15.dart deleted file mode 100644 index d41d075a39..0000000000 --- a/Language/Libraries_and_Scripts/Parts/compilation_t15.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2014, 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 Compiling a part directive of the form part s; causes the Dart -/// system to attempt to compile the contents of the URI that is the value of s. -/// The top-level declarations at that URI are then compiled by the Dart compiler -/// in the scope of the current library. It is a compile-time error if the -/// contents of the URI are not a valid part declaration. -/// -/// @description Checks that `partDirective`, `partHeader` and `libraryName` may -/// contain metadata. -/// @author kaigorodov - -@Annot() -library Parts_test_lib; - -import "../../../Utils/expect.dart"; - -@Annot1.nn(1) -part "part_3.dart"; -@Annot1() -part "part_12.dart"; - -class Annot1 { - final int n; - const Annot1() : n = 0; - const Annot1.nn(int this.n); -} - -main() { - // get/set - value = bar; - Expect.equals(1, value); - value = false; - Expect.equals(false, value); - value = foo; - Expect.equals("foo", value); - value = [1, 2, 3, 4]; - Expect.listEquals([1, 2, 3, 4], value); - - // variables - Expect.isTrue("foo" == foo); - Expect.isTrue(1 == bar); - - // class - A a = new A(); - Expect.isTrue(a is A); - Expect.runtimeIsType(a); -} diff --git a/Language/Libraries_and_Scripts/Parts/part_0.dart b/Language/Libraries_and_Scripts/Parts/part_0.dart deleted file mode 100644 index f1d31a0da0..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_0.dart +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -@Annot() -part of Parts_test_lib; - -class Annot { - const Annot(); -} - -final foo = "foo"; -// ^^^ -// [analyzer] unspecified -// [cfe] unspecified -var bar = 1; diff --git a/Language/Libraries_and_Scripts/Parts/part_1.dart b/Language/Libraries_and_Scripts/Parts/part_1.dart deleted file mode 100644 index 93aa9d98db..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_1.dart +++ /dev/null @@ -1,15 +0,0 @@ -// 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. - -part of Parts_test_lib; - part "part_11.dart"; -//^^^^^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - -class A { } - -get value { return _value; } -set value(value) { _value = value; } -var _value; diff --git a/Language/Libraries_and_Scripts/Parts/part_10.dart b/Language/Libraries_and_Scripts/Parts/part_10.dart deleted file mode 100644 index b0f62d2e93..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_10.dart +++ /dev/null @@ -1,9 +0,0 @@ -// 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. - -part of Parts_test_lib.id; - import 'part_9_lib.dart'; -//^^^^^^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/part_11.dart b/Language/Libraries_and_Scripts/Parts/part_11.dart deleted file mode 100644 index c56540c0bf..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_11.dart +++ /dev/null @@ -1,5 +0,0 @@ -// 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. - -part of Parts_test_lib; diff --git a/Language/Libraries_and_Scripts/Parts/part_12.dart b/Language/Libraries_and_Scripts/Parts/part_12.dart deleted file mode 100644 index 5cd9bb20c7..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_12.dart +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2024, 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. - -@Annot() -part of Parts_test_lib; - -class Annot { - const Annot(); -} - -final foo = "foo"; -var bar = 1; diff --git a/Language/Libraries_and_Scripts/Parts/part_3.dart b/Language/Libraries_and_Scripts/Parts/part_3.dart deleted file mode 100644 index 5bd8dd3c59..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_3.dart +++ /dev/null @@ -1,11 +0,0 @@ -// 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. - -part of Parts_test_lib; - -class A { } - -get value { return _value; } -set value(value) { _value = value; } -var _value; diff --git a/Language/Libraries_and_Scripts/Parts/part_4.dart b/Language/Libraries_and_Scripts/Parts/part_4.dart deleted file mode 100644 index e60a25a0ed..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_4.dart +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -part of Parts_test_lib -// ^^^^^^^^^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified - -get value { return _value; } -set value(value) { _value = value; } - -var _value; diff --git a/Language/Libraries_and_Scripts/Parts/part_6.dart b/Language/Libraries_and_Scripts/Parts/part_6.dart deleted file mode 100644 index e9aecf5bc8..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_6.dart +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -part of Parts_test_lib; - -var foo; - if (foo == null) { -//^ -// [analyzer] unspecified -// [cfe] unspecified - foo = -1; - } diff --git a/Language/Libraries_and_Scripts/Parts/part_7.dart b/Language/Libraries_and_Scripts/Parts/part_7.dart deleted file mode 100644 index 6adad5796e..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_7.dart +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -part of Parts_test_lib; - -class A { } - -get value { return _value; } -set value(value) { _value = value; } -var _value; - - 12 -//^^ -// [analyzer] unspecified -// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/part_8.dart b/Language/Libraries_and_Scripts/Parts/part_8.dart deleted file mode 100644 index ab2deb8f5c..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_8.dart +++ /dev/null @@ -1,10 +0,0 @@ -// 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. - -part of Parts_test_lib; - - static final foo = "FOO"; -//^^^^^^ -// [analyzer] unspecified -// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/part_9.dart b/Language/Libraries_and_Scripts/Parts/part_9.dart deleted file mode 100644 index 0eab6aaa74..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_9.dart +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -// TODO (sgrekhov) Add expected analyzer error below. For now (Feb, 2024) -// analyzer doesn't analyze parts, this error is not reported by the analyzer -// and this is not an error but an intended behavior. -// See https://github.com/dart-lang/sdk/issues/54661 - -/**/part of Parts_test_lib; -/**/import 'part_9_lib.dart'; -// ^^^^^^ -// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/part_9_lib.dart b/Language/Libraries_and_Scripts/Parts/part_9_lib.dart deleted file mode 100644 index 2356160df8..0000000000 --- a/Language/Libraries_and_Scripts/Parts/part_9_lib.dart +++ /dev/null @@ -1,7 +0,0 @@ -// 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. - -library Part_9_lib; - -var foo = 1; diff --git a/Language/Libraries_and_Scripts/Parts/static_warning_t01.dart b/Language/Libraries_and_Scripts/Parts/reference_t01.dart similarity index 60% rename from Language/Libraries_and_Scripts/Parts/static_warning_t01.dart rename to Language/Libraries_and_Scripts/Parts/reference_t01.dart index dffc8677df..62fe644dd0 100644 --- a/Language/Libraries_and_Scripts/Parts/static_warning_t01.dart +++ b/Language/Libraries_and_Scripts/Parts/reference_t01.dart @@ -2,21 +2,18 @@ // 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 static warning if the referenced part declaration p names -/// a library other than the current library as the library to which p belongs. +/// @assertion It is a compile-time error if the referenced part declaration `p` +/// names a library other than the current library as the library to which `p` +/// belongs. +/// /// @description Checks that it is a compile error if the referenced part names /// another library. /// @author rodionov -library Parts_test_lib_not; -part "part_3.dart"; +part 'reference_t01_part.dart'; // ^ // [analyzer] unspecified // [cfe] unspecified main() { - A(); -//^ -// [analyzer] unspecified -// [cfe] unspecified } diff --git a/Language/Libraries_and_Scripts/Parts/reference_t01_lib.dart b/Language/Libraries_and_Scripts/Parts/reference_t01_lib.dart new file mode 100644 index 0000000000..7cbba00c76 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/reference_t01_lib.dart @@ -0,0 +1,13 @@ +// Copyright (c) 2024, 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-time error if the referenced part declaration `p` +/// names a library other than the current library as the library to which `p` +/// belongs. +/// +/// @description Checks that it is a compile error if the referenced part names +/// another library. +/// @author sgrekhov22@gmail.com + +part "reference_t01_part.dart"; diff --git a/Language/Libraries_and_Scripts/Parts/reference_t01_part.dart b/Language/Libraries_and_Scripts/Parts/reference_t01_part.dart new file mode 100644 index 0000000000..459c073575 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/reference_t01_part.dart @@ -0,0 +1,13 @@ +// Copyright (c) 2024, 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-time error if the referenced part declaration `p` +/// names a library other than the current library as the library to which `p` +/// belongs. +/// +/// @description Checks that it is a compile error if the referenced part names +/// another library. +/// @author sgrekhov22@gmail.com + +part of "reference_t01_lib.dart"; diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t01.dart b/Language/Libraries_and_Scripts/Parts/syntax_t01.dart index 07f870789d..f3bfacd6c7 100644 --- a/Language/Libraries_and_Scripts/Parts/syntax_t01.dart +++ b/Language/Libraries_and_Scripts/Parts/syntax_t01.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// Copyright (c) 2014, 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. @@ -7,24 +7,31 @@ /// part directives. /// A part directive specifies a URI where a Dart compilation unit that should /// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. -/// @description Checks that part unit can not contain an import directive. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// +/// @description Checks that `partDirective`, `partHeader` and `libraryName` may +/// contain metadata. /// @author kaigorodov -/// @issue 44990 -library Parts_test_lib.id; -part "part_10.dart"; +import "../../../Utils/expect.dart"; + +@Annot1.nn(1) +part "syntax_t01_part1.dart"; +@Annot1() +part "syntax_t01_part2.dart"; + +class Annot1 { + final int n; + const Annot1() : n = 0; + const Annot1.nn(int this.n); +} main() { + Expect.equals("foo", foo); + Expect.equals("bar", bar); } diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t01_part1.dart b/Language/Libraries_and_Scripts/Parts/syntax_t01_part1.dart new file mode 100644 index 0000000000..84ea648d9b --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/syntax_t01_part1.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2024, 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 A library may be divided into parts, each of which can be stored +/// in a separate location. A library identifies its parts by listing them via +/// part directives. +/// A part directive specifies a URI where a Dart compilation unit that should +/// be incorporated into the current library may be found. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// +/// @description Checks that `partDirective`, `partHeader` and `libraryName` may +/// contain metadata. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t01.dart'; + +String foo = "foo"; diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t01_part2.dart b/Language/Libraries_and_Scripts/Parts/syntax_t01_part2.dart new file mode 100644 index 0000000000..3b9cf0baa0 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/syntax_t01_part2.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2024, 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 A library may be divided into parts, each of which can be stored +/// in a separate location. A library identifies its parts by listing them via +/// part directives. +/// A part directive specifies a URI where a Dart compilation unit that should +/// be incorporated into the current library may be found. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// +/// @description Checks that `partDirective`, `partHeader` and `libraryName` may +/// contain metadata. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t01.dart'; + +String bar = "bar"; diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t02.dart b/Language/Libraries_and_Scripts/Parts/syntax_t02.dart index 8284a62e23..5d8b4aa021 100644 --- a/Language/Libraries_and_Scripts/Parts/syntax_t02.dart +++ b/Language/Libraries_and_Scripts/Parts/syntax_t02.dart @@ -7,25 +7,18 @@ /// part directives. /// A part directive specifies a URI where a Dart compilation unit that should /// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// /// @description Checks that part directive must end with a semicolon. /// @author rodionov - -library Parts_test_lib; -part "part_0.dart" -// ^ +part 'syntax_t02_part.dart' +// ^ // [analyzer] unspecified // [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t02_part.dart b/Language/Libraries_and_Scripts/Parts/syntax_t02_part.dart new file mode 100644 index 0000000000..60c4fef2d5 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/syntax_t02_part.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2024, 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 A library may be divided into parts, each of which can be stored +/// in a separate location. A library identifies its parts by listing them via +/// part directives. +/// A part directive specifies a URI where a Dart compilation unit that should +/// be incorporated into the current library may be found. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// +/// @description Checks that part directive must end with a semicolon. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t02.dart'; diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t03.dart b/Language/Libraries_and_Scripts/Parts/syntax_t03.dart index 492a5ebb62..3058fb61b9 100644 --- a/Language/Libraries_and_Scripts/Parts/syntax_t03.dart +++ b/Language/Libraries_and_Scripts/Parts/syntax_t03.dart @@ -7,25 +7,18 @@ /// part directives. /// A part directive specifies a URI where a Dart compilation unit that should /// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// /// @description Checks that it is a compile-time error when the part's URI is /// not enclosed in quotes. /// @author rodionov - -library Parts_test_lib; -part part_3.dart +part syntax_t03_part.dart // ^ // [analyzer] unspecified // [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t03_part.dart b/Language/Libraries_and_Scripts/Parts/syntax_t03_part.dart new file mode 100644 index 0000000000..100ad64154 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/syntax_t03_part.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2024, 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 A library may be divided into parts, each of which can be stored +/// in a separate location. A library identifies its parts by listing them via +/// part directives. +/// A part directive specifies a URI where a Dart compilation unit that should +/// be incorporated into the current library may be found. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// +/// @description Checks that it is a compile-time error when the part's URI is +/// not enclosed in quotes. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t03.dart'; diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t04.dart b/Language/Libraries_and_Scripts/Parts/syntax_t04.dart deleted file mode 100644 index 6e81ac1cf6..0000000000 --- a/Language/Libraries_and_Scripts/Parts/syntax_t04.dart +++ /dev/null @@ -1,34 +0,0 @@ -// 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 A library may be divided into parts, each of which can be stored -/// in a separate location. A library identifies its parts by listing them via -/// part directives. -/// A part directive specifies a URI where a Dart compilation unit that should -/// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. -/// @description Checks that it is a compile-time error if a part directive -/// begins with a '#' character. -/// @author rodionov - - -library Parts_test_lib; -#part "part_12.dart"; -//^ -// [analyzer] unspecified -// [cfe] unspecified - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t05.dart b/Language/Libraries_and_Scripts/Parts/syntax_t05.dart index b3db6ea8d8..60f5c31fec 100644 --- a/Language/Libraries_and_Scripts/Parts/syntax_t05.dart +++ b/Language/Libraries_and_Scripts/Parts/syntax_t05.dart @@ -7,24 +7,17 @@ /// part directives. /// A part directive specifies a URI where a Dart compilation unit that should /// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// /// @description Checks that it is a compile-time error when a part directive /// is missing the URI entirely. /// @author rodionov - -library Parts_test_lib; part; // ^ // [analyzer] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t06.dart b/Language/Libraries_and_Scripts/Parts/syntax_t06.dart index bc7c987d56..0f11b491f3 100644 --- a/Language/Libraries_and_Scripts/Parts/syntax_t06.dart +++ b/Language/Libraries_and_Scripts/Parts/syntax_t06.dart @@ -7,24 +7,17 @@ /// part directives. /// A part directive specifies a URI where a Dart compilation unit that should /// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. +/// +/// ::= `part' `;' +/// ::= `part' `of' `;' +/// ::= +/// * * ( +/// )* +/// /// @description Checks that it is a compile-time error when the resource /// specified by the URI does not exist. /// @author rodionov - -library Parts_test_lib; part "IntentionallyMissingFile.dart"; // ^ // [analyzer] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t07.dart b/Language/Libraries_and_Scripts/Parts/syntax_t07.dart deleted file mode 100644 index dc1e71a851..0000000000 --- a/Language/Libraries_and_Scripts/Parts/syntax_t07.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 A library may be divided into parts, each of which can be stored -/// in a separate location. A library identifies its parts by listing them via -/// part directives. -/// A part directive specifies a URI where a Dart compilation unit that should -/// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. -/// @description Checks that in a compile-time error if the part directive -/// includes an additive expression instead of URI. -/// @author rodionov - - -part 0+0; -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/syntax_t08.dart b/Language/Libraries_and_Scripts/Parts/syntax_t08.dart deleted file mode 100644 index 4421cadae1..0000000000 --- a/Language/Libraries_and_Scripts/Parts/syntax_t08.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 A library may be divided into parts, each of which can be stored -/// in a separate location. A library identifies its parts by listing them via -/// part directives. -/// A part directive specifies a URI where a Dart compilation unit that should -/// be incorporated into the current library may be found. -/// partDirective: -/// metadata part uri ';' -/// ; -/// partHeader: -/// metadata part of identifier (‘.’ identifier)* ‘;’ -/// ; -/// partDeclaration: -/// partHeader topLevelDefinition* EOF -/// ; -/// A part header begins with part of followed by the name of the library the -/// part belongs to. A part declaration consists of a part header followed by a -/// sequence of top-level declarations. -/// @description Checks that it is a compile-time error if the part directive -/// includes a function invocation expression instead of URI. -/// @author rodionov - - -part new StringBuffer("part_0.dart").toString(); -// ^ -// [analyzer] unspecified -// [cfe] unspecified - -main() { -} diff --git a/Language/Libraries_and_Scripts/Parts/uri_contents_t01.dart b/Language/Libraries_and_Scripts/Parts/uri_contents_t01.dart new file mode 100644 index 0000000000..91c0978465 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_contents_t01.dart @@ -0,0 +1,17 @@ +// 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-time error if the contents of the URI are not a +/// valid part declaration. +/// +/// @description Checks that it is a compile-time error if the contents of an +/// URI is not a valid part declaration (syntax error in a top-level +/// declaration). +/// @author rodionov + +part "uri_contents_t01_part.dart"; + +main() { + print(foo); +} diff --git a/Language/Libraries_and_Scripts/Parts/uri_contents_t01_part.dart b/Language/Libraries_and_Scripts/Parts/uri_contents_t01_part.dart new file mode 100644 index 0000000000..54fd37a510 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_contents_t01_part.dart @@ -0,0 +1,18 @@ +// 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-time error if the contents of the URI are not a +/// valid part declaration. +/// +/// @description Checks that it is a compile-time error if the contents of an +/// URI is not a valid part declaration (syntax error in a top-level +/// declaration). +/// @author rodionov + +part of 'uri_contents_t01.dart'; + +/**/static final foo = "FOO"; +// ^^^^^^ +// [analyzer] unspecified +// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/Parts/uri_contents_t02.dart b/Language/Libraries_and_Scripts/Parts/uri_contents_t02.dart new file mode 100644 index 0000000000..657fc465b9 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_contents_t02.dart @@ -0,0 +1,22 @@ +// 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-time error if the contents of the URI are not a +/// valid part declaration. +/// +/// @description Checks that it is a compile-time error when a part file +/// contains a library definition instead of a part declaration. +/// @author rodionov + +part "uri_contents_t02_part.dart"; +// ^ +// [analyzer] unspecified +// [cfe] unspecified + +main() { + var x = foo; +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} diff --git a/Language/Libraries_and_Scripts/Parts/uri_contents_t02_part.dart b/Language/Libraries_and_Scripts/Parts/uri_contents_t02_part.dart new file mode 100644 index 0000000000..158f83e366 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_contents_t02_part.dart @@ -0,0 +1,13 @@ +// 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-time error if the contents of the URI are not a +/// valid part declaration. +/// +/// @description Checks that it is a compile-time error when a part file +/// contains a library definition instead of a part declaration. + +library uri_contents_t02_part; + +var foo = 1; diff --git a/Language/Libraries_and_Scripts/Parts/uri_t01.dart b/Language/Libraries_and_Scripts/Parts/uri_t01.dart new file mode 100644 index 0000000000..7755a79a0e --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_t01.dart @@ -0,0 +1,20 @@ +// 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-time error if a library contains two part +/// directives with the same URI. +/// +/// @description Checks that it is a compile-time error if a library contains +/// two part directives with the same URI. +/// @author rodionov +/// @issue 46998 + +part 'uri_t01_part.dart'; +part 'uri_t01_part.dart'; +// ^ +// [analyzer] unspecified + +main() { + print(uri_t01_part_var); +} diff --git a/Language/Libraries_and_Scripts/Parts/uri_t01_part.dart b/Language/Libraries_and_Scripts/Parts/uri_t01_part.dart new file mode 100644 index 0000000000..01a25e7b56 --- /dev/null +++ b/Language/Libraries_and_Scripts/Parts/uri_t01_part.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2024, 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-time error if a library contains two part +/// directives with the same URI. +/// +/// @description Checks that it is a compile-time error if a library contains +/// two part directives with the same URI. +/// @author sgrekhov22@gmail.com + +part of 'uri_t01.dart'; + +var uri_t01_part_var = "uri_t01_part_var";