Edge SDK fails to compile front_end 0.1.4+1

This looks like either a new error in the CFE or a mismatch in versions between front_end and kernel, which was fixed in front_end 0.1.5. However, you can’t actually get that version without depending on the alpha version of the analyzer, which the world hasn’t rolled to yet.

SDK version: Dart VM version: 2.1.0-edge.0cc7993ee356e7858dcc05964253b4a4e9a48ef9 (Thu Oct 4 14:54:28 2018 +0000) on “linux_x64”
Fetched from: https://storage.googleapis.com/dart-archive/channels/be/raw/latest/sdk/dartsdk-linux-x64-release.zip

Example failure:

file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/expression_generator.dart:789:14: Error: The method 'ErroneousExpressionGenerator::buildCompoundAssignment' has fewer named arguments than those of overridden method 'KernelExpressionGenerator::buildCompoundAssignment'.
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:180:14: Context: This is the overridden method ('buildCompoundAssignment').
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:1521:7: Context: Override was introduced when the mixin 'ErroneousExpressionGenerator' was applied to 'KernelGenerator'.
class KernelUnresolvedNameGenerator extends KernelGenerator
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/expression_generator.dart:789:14: Error: The method 'ErroneousExpressionGenerator::buildCompoundAssignment' doesn't have the named parameter 'isPostIncDec' of overridden method 'KernelExpressionGenerator::buildCompoundAssignment'.
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:180:14: Context: This is the overridden method ('buildCompoundAssignment').
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:1521:7: Context: Override was introduced when the mixin 'ErroneousExpressionGenerator' was applied to 'KernelGenerator'.
class KernelUnresolvedNameGenerator extends KernelGenerator
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/expression_generator.dart:952:14: Error: The method 'ContextAwareGenerator::buildCompoundAssignment' has fewer named arguments than those of overridden method 'KernelExpressionGenerator::buildCompoundAssignment'.
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:180:14: Context: This is the overridden method ('buildCompoundAssignment').
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,
             ^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/kernel_expression_generator.dart:1612:16: Context: Override was introduced when the mixin 'ContextAwareGenerator' was applied to 'KernelGenerator'.
abstract class KernelContextAwareGenerator extends KernelGenerator
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
file:///<redacted>/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.4+1/lib/src/fasta/kernel/expression_generator.dart:952:14: Error: The method 'ContextAwareGenerator::buildCompoundAssignment' doesn't have the named parameter 'isPostIncDec' of overridden method 'KernelExpressionGenerator::buildCompoundAssignment'.
  Expression buildCompoundAssignment(Name binaryOperator, Expression value,

Reproduction Instructions

Create a new package which depends on the analyzer at <0.33.0 version (which was just released and the world has to migrate to still), and a dart script that imports analyzer:

pubspec.yaml:

name: repro
  dependencies:
    analyzer: <0.33.0

main.dart:

import 'package:analyzer/analyzer.dart';
main() {}

Try to snapshot the script:

dart --snapshot=main.dart.snapshot main.dart

Author: Fantashit

1 thought on “Edge SDK fails to compile front_end 0.1.4+1

Comments are closed.