Skip to content

universal function type RTTI is not working #28079

Closed
@jmesserly

Description

@jmesserly

from @vsmenon comment here: #27952 (comment)

The original example now gives a static error. If I change foo(h, 42) to foo(h as dynamic, 42), I do get a runtime error:

Type 'JSObject<makeGenericFnType>' is not a subtype of type '(Object) -> dynamic'

the repro is:

h/*<T>*/(a) {
  return a as dynamic/*=T*/;
}

Object foo(f(Object a), Object a) {
  return f(a);
}

void main() {
  var x = foo(h as dynamic, 42);
  print(x);
}

the type of h is showing up as JSObject<makeGenericFnType> but it should be <T>(dynamic) -> dynamic

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ontype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)web-dev-compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions