Description
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)