lib1.dart:
class A { int _x; } class B { int _x; }
lib2.dart:
import 'lib1.dart'; class C extends A with B {}
error • The private name _x, defined by B, conflicts with the same name defined by A at tmp/lib2.dart:3:24 • private_collision_in_mixin_application
Breaking change - strong mode will prefer the expected type to infer generic types, functions, and methods (SDK issue 27586).
main() { List<Object> foo = /*infers: <Object>*/['hello', 'world']; var bar = /*infers: <String>*/['hello', 'world']; }
Strong mode inference error messages are improved (SDK issue 29108).
import 'dart:math'; test(Iterable/* fix is to add <num> here */ values) { num n = values.fold(values.first as num, max); }
Now produces the error on the generic function "max":
Couldn't infer type parameter 'T'.
Tried to infer 'dynamic' for 'T' which doesn't work:
Function type declared as '<T extends num>(T, T) → T'
used where '(num, dynamic) → num' is required.
Consider passing explicit type argument(s) to the generic.
Strong mode supports overriding fields, @virtual
is no longer required (SDK issue 28120).
class C { int x = 42; } class D extends C { get x { print("x got called"); return super.x; } } main() { print(new D().x); }
Strong mode down cast composite warnings are no longer issued by default. (SDK issue 28588).
void test() { List untyped = []; List<int> typed = untyped; // No down cast composite warning }
To opt back into the warnings, add the following to the .analysis_options file for your project.
analyzer:
errors:
strong_mode_down_cast_composite: warning
dart:core
Uri.isScheme
function to check the scheme of a URI. Example: uri.isScheme("http")
. Ignores case when comparing.UriData.parse
validate its input better. If the data is base-64 encoded, the data is normalized wrt. alphabet and padding, and it contains invalid base-64 data, parsing fails. Also normalizes non-base-64 data.dart:io
File.lastAccessed
, File.lastAccessedSync
, File.setLastModified
, File.setLastModifiedSync
, File.setLastAccessed
, and File.setLastAccessedSync
.{Stdin,Stdout}.supportsAnsiEscapes
.print()
and Stdout.write*()
now correctly print unicode characters to the console on Windows. Calls to Stdout.add*()
behave as before.Analysis
dartanalyzer
now follows the same rules as the analysis server to find an analysis options file, stopping when an analysis options file is found:package:flutter
.package:dart.analysis_options/default.yaml
if it exists.dartanalyzer
:--options
and that file will be used instead of searching for an analysis options file.--strong
or --no-strong
) takes precedence over any corresponding value specified in the analysis options file.Dartium, dart2js, and DDC
dart:io
are allowed, but the imported library is not supported and will likely fail on most APIs at runtime. This change was made as a stopgap measure to make it easier to write libraries that share code between platforms (like package http
). This might change again when configuration specific imports are supported.Pub
pub.dartlang.org
to allow better understanding of why a particular package is being accessed.pub publish
lib/
or bin/
, or a package that's not a dev dependency from within benchmark/
, example/
, test/
or tool/
.pub get
and pub upgrade
dartfmt
-
and --
. Code that does this is pathological, but it technically meant dartfmt could change the semantics of the code.--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.