Fix cast of nullable argument (#112)

The `as num` cast existed before the migration, but in the wrong place
so the overall expression was still `dynamic`. Implicit casts from
`dynamic` are still allowed, so it wasn't flagged that the cast was in
the wrong place - disabling implicit casts from dynamic makes it more
obvious that there is a problem, but doesn't fix the entire issue.

In addition to the cast being in the wrong place, it also was to the
wrong type. Casting to `num` instead of `num?` does not surface any
warnings because it's valid to pass the `num` to an argument wanting

This was not surfaced originally due to a bug in the VM which causes the
opt-in state of a package in the experiment allow list to _not_ control
the soundness when executing. Add explicit opt in test runs for now.
2 files changed
tree: 3357c4c5a3cc3ad9943e33c86e86ee214dde3931
  1. example/
  2. lib/
  3. test/
  4. .gitignore
  5. .test_config
  6. .travis.yml
  7. analysis_options.yaml
  10. pubspec.yaml

A Dart CSS parser.


Parsing CSS is easy!

import 'package:csslib/parser.dart';

main() {
  var stylesheet = parse(
      '.foo { color: red; left: 20px; top: 20px; width: 100px; height:200px }');

You can pass a String or List<int> to parse.