Skip to content

strict-inference doesn't complain about example given in its doc #45371

Open
@goderbauer

Description

@goderbauer

According to [1] the following should report an inference failure when strict-inference is turned on:

void main() {
  var a = [1, 2, 3].fold(true, (s, x) => s + x);
}

However, in an example project with the analysis_options.yaml file posted below no infernece issue is reported on Dart 2.13.0 (build 2.13.0-143.0.dev). (The only issue reported is an unused variable a.)

analyzer:
  language:
    strict-inference: true

[1] https://github.com/dart-lang/language/blob/master/resources/type-system/strict-inference.md#example-under-constrained-generic-method-invocations

/cc @srawlins

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codestype-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions