Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

dynamic calls on some operators seems broken? #502

Closed
@vsmenon

Description

@vsmenon

The following Dart:

bool inRange(min, value, max) => (min <= value) && (value <= max);

void main() {
  var result = inRange(2, 7, 10);
  print(result);
}

generates this:

  test.inRange = function(min, value, max) {
    return dart.as(dart.dsend(min, '<=', value), core.bool)['&&'](dart.as(dart.dsend(value, '<=', max), core.bool));
  };

  test.main = function() {
    let result = setteronly.inRange(2, 7, 10);
    core.print(result);
  };

which, at runtime, triggers:

Uncaught TypeError: dart.as(...).&& is not a function

It's fine if inRange parameters are typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions