Describe the bug
Examples:
This one works
(defn async-int ^#/(Future int) []
(dasync/Future.value 1))
This one doesn't
(defn ^:async async-int ^#/(Future int) []
(dasync/Future.value 1))
Error: A value of type 'FutureOr<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
return ((da.Future.value(1, )) as da.FutureOr<dc.Future<dc.int>>);
Also, sometimes removing ^:async doesn't help:
(defn async-int-after-job ^#/(Future int) []
(let [value 1
job (dasync/Future.value true)]
(await job)
(dasync/Future.value value)))
Error: A value of type 'FutureOr<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
return ($1 as da.FutureOr<dc.Future<dc.int>>);
But removing type hint (or moving it before name) helps
(defn ^#/(Future int) async-int-after-job []
(let [value 1
job (dasync/Future.value true)]
(await job)
(dasync/Future.value value)))
Describe the bug
Examples:
This one works
This one doesn't
Also, sometimes removing ^:async doesn't help:
But removing type hint (or moving it before name) helps