Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow implicit dynamic to be inferred from explicit dynamic #27624

Closed
nex3 opened this issue Oct 19, 2016 · 1 comment
Closed

Allow implicit dynamic to be inferred from explicit dynamic #27624

nex3 opened this issue Oct 19, 2016 · 1 comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. strict-analysis-needed Mark issues where strict-raw-types, strict-inference and similar analysis options were helpful type-enhancement A request for a change that isn't a bug

Comments

@nex3
Copy link
Member

nex3 commented Oct 19, 2016

Consider the following code:

class Foo {
  List<dynamic> values;

  Foo(Iterable<dynamic> values)
      : values = new List.unmodifiable(values);
}

When I run dartanalyzer --strong --no-implicit-dynamic on this, I get:

[error] Missing type arguments for generic type 'List<dynamic>'. Either add an explicit type like 'dynamic', or enable implicit-dynamic in your Analyzer options.

This seems counterproductive. I'm explicitly declaring types at my API boundaries, and I expect them to be inferred elsewhere, just like they would be if I'd written <String> instead of <dynamic>.

@nex3 nex3 added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-strong-mode type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-enhancement A request for a change that isn't a bug and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Oct 19, 2016
@jmesserly
Copy link

merging into #26781

@eernstg eernstg added the strict-analysis-needed Mark issues where strict-raw-types, strict-inference and similar analysis options were helpful label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. strict-analysis-needed Mark issues where strict-raw-types, strict-inference and similar analysis options were helpful type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants