Unsound implicit throw warning not shown for general parameter

Is it a mistake or some reasonable behavior that in strong mode this code

  Set<Set<int>> ssi() => ssd();
  Set<Set<dynamic>> ssd() => new Set.from(new Set.from(["string"]));

works fine but it

  Set<int> si() => sd();
  Set<dynamic> sd() => new Set.from(["string"]);

creates WARNING: Unsound implicit cast from Set<dynamic> to Set<int>?

+4
source share
1 answer

Adding

analyzer:
  strong-mode:
    implicit-casts: false

It .analysis_optionsturns out

enter image description here

0
source

Source: https://habr.com/ru/post/1662281/


All Articles