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.

is / as checks unnecessarily fail at runtime #524

Closed
@vsmenon

Description

@vsmenon

This test throws a strong mode error at runtime. No static errors or warnings.

typedef String Predicate(x);

String foo(x) {
  if (x is Predicate) {
    return x("hello");
  } if (x is String) {
    return x;
  } else {
    return "unexpected value";
  }
}

void main() {
  print(foo("test"));
}

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