Skip to content

Commit a850f3c

Browse files
committed
opt working/macros/example/bin/run.dart into null safety
1 parent 2be62bd commit a850f3c

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

working/macros/example/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ actually running those examples.
66

77
## Setup
88

9-
You may need to edit the `pubspec.yaml` file to run these examples. It requires
10-
a path dependency on the SDK packages to work (until
11-
https://github.com/dart-lang/pub/issues/3336 is resolved). The current paths
12-
assume the dart sdk is in a sibling directory to the language repo, in a
13-
directory called `dart-lang-sdk`.
14-
15-
Your SDK will also need to be very recent, in particular it must include
16-
commit 54e773.
9+
Your SDK will need to match roughly the commit pinned in the pubspec.yaml file
10+
of this package (see the `ref` lines). Otherwise you will get a kernel version
11+
mismatch.
1712

1813
## Benchmarks
1914

working/macros/example/bin/run.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
4-
//
5-
// @dart=2.9
64

75
import 'dart:io';
86
import 'dart:isolate';
@@ -46,7 +44,7 @@ void main() async {
4644
File(bootstrapFile.uri.resolve('bootstrap.dart.dill').toFilePath());
4745

4846
var feAnalyzerSharedRoot = (await Isolate.resolvePackageUri(
49-
Uri.parse('package:_fe_analyzer_shared/fake.dart')))
47+
Uri.parse('package:_fe_analyzer_shared/fake.dart')))!
5048
.resolve('./');
5149

5250
log('Compiling macro program to kernel (${bootstrapKernelFile.path})');
@@ -90,7 +88,7 @@ void main() async {
9088
'--output',
9189
output.path,
9290
'--source',
93-
Platform.script.resolve('user_main.dart').toFilePath(),
91+
Uri.base.resolve('bin/user_main.dart').toFilePath(),
9492
'--packages-file=.dart_tool/package_config.json',
9593
'--enable-experiment=macros',
9694
'--precompiled-macro-format=kernel',

0 commit comments

Comments
 (0)