Skip to content

[dart2js] Bug in inferred type of static closure call method tear-off #60895

@rakudrama

Description

@rakudrama

Consider

import 'dart:typed_data';

String foo() => "Lily was here";

main() {
  var f = foo;
  var x = f.call;
  (print)("Lily was here" == x());
  //(print)(Uint8List(0));
}

Running:
dart compile js foo.dart --out=o1.js && v8 o1.js:

true

Uncomment the last line in main, and run again:

false
[]

It appears that adding a live @Native class causes the inferred type of the tear-off to be Never.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dart2js

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions