File tree Expand file tree Collapse file tree 7 files changed +68
-0
lines changed Expand file tree Collapse file tree 7 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // A perfectly legal dart library for use with script and library tests.
6
+
7
+ library ScriptLib;
8
+
9
+ const int scriptLib = 1 ;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ int ok = 1 ;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ part of "script1_test.dart" ;
6
+
7
+ const int scriptPart = 1 ;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ /// Wrong order of import and part directives.
6
+
7
+ part "script1_part.dart" ;
8
+ import "script1_lib.dart" ;
9
+ // [error line 8, column 1, length 6]
10
+ // [analyzer] SYNTACTIC_ERROR.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
11
+ // [cfe] Import directives must precede part directives.
12
+
13
+ main () {
14
+ print ("Should not reach here." );
15
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ library Script2Part;
6
+ import "lib.dart" ;
7
+
8
+ part of "script2_test.dart" ;
9
+
10
+ const int scriptPart = 1 ;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ /// Part file has library and import directives.
6
+
7
+ /*@compile-error=unspecified*/
8
+ // TODO(rnystrom): Using the above tag instead of making this a static error
9
+ // test because the error is reported in the part file and not in this file.
10
+ // Static error tests only support errors reported in the main test file itself.
11
+ part "script2_part.dart" ;
12
+
13
+ main () {
14
+ print ("Should not reach here." );
15
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ // A perfectly legal dart source file for use with script and library tests.
6
+
7
+ const int script_source = 1 ;
You can’t perform that action at this time.
0 commit comments