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

support function types #358

Closed
mhevery opened this issue Apr 3, 2016 · 2 comments
Closed

support function types #358

mhevery opened this issue Apr 3, 2016 · 2 comments

Comments

@mhevery
Copy link

mhevery commented Apr 3, 2016

Given:

  method(fn: (V, K) => void) { ... }

Expected:

  method(void fn(V arg0, K arg1)) { ... }

Actual:

  method(dynamic /* (V, K) => void */ fn) { ... }

/cc: @vsmenon

@mprobst
Copy link
Contributor

mprobst commented Apr 4, 2016

How does this interact with generic method types? Maybe this?

f/*<A, B>*/(dynamic/*=B*/ fn(dynamic/*=A*/ a)) {}

How does this look for recursive types function typed arguments, e.g. functions that take functions that take functions?

mprobst added a commit that referenced this issue Apr 4, 2016
Dart does not support general function types, but has special-cased support for
function types in parameters.

Fixes #358.
@vsmenon
Copy link

vsmenon commented Apr 4, 2016

That looks correct on generics.

Here's an example with function typed arguments:

void foo(String bar(String baz())) {
  var result = bar(() => "hello");
  print(result);
}

mprobst added a commit that referenced this issue Apr 4, 2016
Summary:
Dart does not support general function types, but has special-cased support for
function types in parameters.

Fixes #358.

Reviewers: mhevery

Subscribers: typescript-eng

Differential Revision: https://reviews.angular.io/D37
@mprobst mprobst closed this as completed in c035ef3 Apr 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants