Skip to content

More issues with "+" and other binary operators #596

Closed
@dgrove

Description

@dgrove

svn r1844

This is along the lines of issue #576.

f() => 77;

main() {
print(f() + "88");
}

frog produces "7788", while the VM throws:
NoSuchMethodException - receiver: '88' function name: 'addFromInteger' arguments: [77]]
 0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:315 col:3
 1. Function: 'IntegerImplementation.+' url: 'bootstrap_impl' line:1463 col:32
 2. Function: '::.main' url: '/Users/dgrove/repo/dart-bleeding/dart/frog/y.dart' line:4 col:11

You can see similar results with

print(f() & "88")
print(f() - "88")

I see a few other cases where frog is pushing onto the JS operator incorrectly. for instance,

print(foo() >> (-1)); // frog: 0, VM: unhandled exception
print(foo() << (-1));

In general, these issues are appearing because frog is being overly aggressive in pushing down onto the JS operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failures

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions