Files
sdk/pkg/dartfix/example/example.dart
T
Sam Rawlins 44ba800533 dartfix: Fix for new lints in pedantic 0.9:
* always_declare_return_types
* annotate_overrides
* prefer_null_aware

Change-Id: I981b54b7d3422f08a990d0ac2c52ca5f4e65ac39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128312
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-16 04:11:26 +00:00

26 lines
890 B
Dart

// Copyright (c) 2019, 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.
// This file contains code that is modified by running dartfix.
// After running dartfix, this content matches a file in the "fixed" directory.
// Dart will automatically convert int literals to doubles.
// Running dartfix converts this double literal to an int
// if --double-to-int is specified on the command line.
const double myDouble = 4.0;
// This class is used as a mixin but does not use the new mixin syntax.
// Running dartfix converts this class to use the new syntax.
class MyMixin {
final someValue = myDouble;
}
class MyClass with MyMixin {}
void main(List<String> args) {
if (args.length == 0) {
print('myDouble = ${MyClass().someValue}');
}
}