Skip to content

universal function type RTTI is not working #28079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmesserly opened this issue Dec 12, 2016 · 4 comments
Closed

universal function type RTTI is not working #28079

jmesserly opened this issue Dec 12, 2016 · 4 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler

Comments

@jmesserly
Copy link

jmesserly commented Dec 12, 2016

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

@jmesserly
Copy link
Author

node dcalls also do not work on these, likely for the same reason, see #28105

@jmesserly jmesserly self-assigned this Dec 15, 2016
@mit-mit mit-mit modified the milestones: 1.22, 1.50 Dec 28, 2016
@vsmenon vsmenon added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Jan 9, 2017
@munificent munificent removed this from the 1.22 milestone Jan 12, 2017
@jmesserly jmesserly self-assigned this Jan 24, 2017
@jmesserly
Copy link
Author

I will probably wait for this CL to land: https://codereview.chromium.org/2623053004/ as it changes a lot of function type tracking in DDC

@jmesserly jmesserly added this to the 1.23 milestone Mar 6, 2017
@vsmenon vsmenon removed this from the 1.23 milestone Mar 9, 2017
@jmesserly
Copy link
Author

jmesserly commented Apr 10, 2017

I've got a test for this. Things seem to be working correctly in terms of dynamic calls. The main issue is we don't print the type in a reasonable way.

EDIT: also we don't implement subtype relation at all. Working on that.

@jmesserly
Copy link
Author

This is basically fixed in d26bb56. I've got one more test I'm going to look at landing for it but otherwise we're good to go here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler
Projects
None yet
Development

No branches or pull requests

4 participants