Skip to content
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

VM: Support generalized void #30516

Closed
eernstg opened this issue Aug 22, 2017 · 6 comments
Closed

VM: Support generalized void #30516

eernstg opened this issue Aug 22, 2017 · 6 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@eernstg
Copy link
Member

eernstg commented Aug 22, 2017

This is the VM specific issue for issue #30176, which contains the details.

This issue was created in order to have a suitable issue number to refer to in status files.

The implementation of support for generalized void in the VM should be coordinated with that of other tools, and in particular most or all of it may be provided by the common front end. Hence, please do not start implementing this in the VM at this point.

@eernstg eernstg mentioned this issue Aug 22, 2017
8 tasks
@eernstg eernstg added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Aug 22, 2017
@a-siva a-siva added this to the 2.0-alpha milestone Jan 11, 2018
@a-siva
Copy link
Contributor

a-siva commented Jan 11, 2018

A sample code in flutter that could use this feature to avoid strong mode errors

typedef void GestureTapCancelCallback();
GestureTapCancelCallback onTapCancel;
T invokeCallback<T>(String name, RecognizerCallback<T> callback, { String debugReport() }) {
}
main() {
  invokeCallback<void>('spontaneous onTapCancel', onTapCancel);
}

whesse pushed a commit that referenced this issue Jan 11, 2018
This is part of implementing generalized void, see #30516.
Add regression test.
Update status files.

Change-Id: I0b4730734238b4dc463ddd7835e30ea8a2bd4300
Bug:
Reviewed-on: https://dart-review.googlesource.com/34224
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
@crelier
Copy link
Contributor

crelier commented Jan 11, 2018

The VM parser has been fixed to support the sample above involving void as the type argument of a generic function, as in invokeCallback<void>(...).
However, 'void' as type annotation is not yet supported, so this issue remains open for now.

@a-siva
Copy link
Contributor

a-siva commented Jan 20, 2018

How about the following cases

  • void allowed as a parameter type e.g - f(void a) {}
  • void as a variable type e.g - void v = null;
    I suppose these are allowed per the informal spec.

But when I run the VM parser on these examples I get an error.

@crelier
Copy link
Contributor

crelier commented Jan 20, 2018

These cases have not been fixed yet, the reason I left the bug opened. Are we supposed to support this now? My understanding was that only void as type argument was supported at this time. I can start working on it if full support is needed now.

@a-siva
Copy link
Contributor

a-siva commented Jan 20, 2018

I don't know yet if these cases are critical will let you know if I run into these patterns in flutter.

@lrhn
Copy link
Member

lrhn commented Jan 23, 2018

The sooner we support the full new syntax, the sooner we can start migrating the libraries to use it.

@a-siva a-siva modified the milestones: 2.0-alpha1, 2.0-alpha2 Jan 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

4 participants