class ConstClass {
const ConstClass();
}
const int constInt = 3;
const ConstClass constClass = ConstClass();
test4.dart:
import "test5.dart";
Class D {
foo({int a = constInt, ConstClass c = constClass}) {}
}
void main() {}
leafp-macbookpro:language leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64NNBD/dart-sdk/bin/dartanalyzer --enable-experiment=non-nullable ~/tmp/test4.dart
Analyzing /Users/leafp/tmp/test4.dart...
error • The default value of an optional parameter must be constant. • /Users/leafp/tmp/test4.dart:7:16 • non_constant_default_value
error • The default value of an optional parameter must be constant. • /Users/leafp/tmp/test4.dart:7:41 • non_constant_default_value
2 errors found.
cc @scheglov
cc @vsmenon @sigmundch this is one of the remaining dart:io issues
test5.dart:
test4.dart:
cc @scheglov cc @vsmenon @sigmundch this is one of the remaining dart:io issues