Skip to content

inference_failure_on_function_return_type complains about external setters #39250

@nex3

Description

@nex3

With strict inference enabled, this code:

import 'package:js/js.dart';

@JS()
external set foo(int value);

Produces the following analysis hint:

Analyzing test.dart...
  hint • The return type of 'foo' cannot be inferred. • test.dart:3:1 • inference_failure_on_function_return_type                                                                                      
1 hint found.

Adding a return type causes a lint to complain that setters shouldn't declare return types, so it's a lose-lose situation.

Metadata

Metadata

Assignees

Labels

customer-dart-sasslegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions