Skip to content

Frog doesn't respect implicit class interfaces for interface hierarchy #1972

Closed
@sethladd

Description

@sethladd

The following code, which exercises implicit class interfaces:

class Duck {
  quack() => 'complicated enterprise n-tier quack';
}

class MockDuck implements Duck {
  quack() => 'quack for testing';
}

main() {
  var mock = new MockDuck();
  print(mock is Duck); // true!
}

(which I believe is valid, works in Dartboard and Editor shows no warnings. I could be wrong about the validity for these implicit interfaces)

will print false, which is unexpected, when compiled to JavaScript via Frog.

I've attached the compiled JavaScript code. Here is relevant section:

function Duck() {}
// ********** Code for MockDuck **************
function MockDuck() {

}
// ********** Code for top level **************
function main() {
  var mock = new MockDuck();
  print$((mock instanceof Duck));
}


Attachment:
loudify.dart.js (15.62 KB)

Metadata

Metadata

Assignees

Labels

closed-not-plannedClosed as we don't intend to take action on the reported issueweb-dart2js

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions