anchor.diff:  
     @override
     void registerWrite(UnspecifiedDeclaration declaration, Token token) {
  -    trace("Write to ${declaration.name}", token);
  +    // TODO(ahe): Call `note` instead to create expectations.
  +    trace("Write to ${declaration.name}@${declaration.charOffset}", token);
     }
   
     @override
     void registerPromotionCandidate(
         UnspecifiedDeclaration declaration, Token token) {
  -    trace("Possible promotion of ${declaration.name}", token);
  +    // TODO(ahe): Call `note` instead to create expectations.
  +    trace("Possible promotion of ${declaration.name}@${declaration.charOffset}",
  +        token);
     }
   
     @override
  
positive.code: // Copyright (c) 2018, 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 'package:front_end/src/base/processed_options.dart'
      show ProcessedOptions;
  
negative.code:               new Future<CompilerContext>.value(context),
            errorOnMissingInput: false);
    context.disableColors();
    return new TypePromotionLookAheadContext(
        context, environment["updateExpectations"] == "true");
  }
  
  class TypePromotionLookAheadContext extends ChainContext {
    final CompilerContext context;
  
    final List<Step> steps = const <Step>[
      const Read(),
      const Scan(),
      const TypePromotionLookAheadStep(),
      const CheckTypePromotionResult(),
    ];
  
    final bool updateExpectations;
  
    final ExpectationSet expectationSet =
        new ExpectationSet.fromJsonList(jsonDecode(EXPECTATIONS));
  
    TypePromotionLookAheadContext(this.context, this.updateExpectations);
  
    Expectation get expectationFileMismatch =>
        expectationSet["ExpectationFileMismatch"];
  
    Expectation get expectationFileMissing =>
        expectationSet["ExpectationFileMissing"];
  }
  
  class TypePromotionLookAheadStep extends Step<ScannedFile, TypePromotionResult,
      TypePromotionLookAheadContext> {
    const TypePromotionLookAheadStep();
  
    String get name => "Type Promotion Look Ahead";
  
    Future<Result<TypePromotionResult>> run(
        ScannedFile file, TypePromotionLookAheadContext context) async {
      return context.context
          .runInContext<Result<TypePromotionResult>>((CompilerContext c) async {
        Uri uri = file.file.uri;
        c.uriToSource[uri] = new Source(file.result.lineStarts, file.file.bytes);
        StringBuffer buffer = new StringBuffer();
        Parser parser = new Parser(new TestListener(uri, buffer));
        try {
          parser.parseUnit(file.result.tokens);
        } finally {
          c.uriToSource.remove(uri);
        }
        return pass(new TypePromotionResult(uri, "$buffer"));
      });
    }
  }
  
  class TestState extends TypePromotionState {
    final StringBuffer buffer;
  
    TestState(Uri uri, this.buffer) : super(uri);
  
    void note(String message, Token token) {
      buffer.writeln(CompilerContext.current.format(
          debugMessage(message, uri, token.charOffset, token.lexeme.length),
          Severity.context));
    }
  
    @override
    void checkEmpty(Token token) {
  