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

valid cljd code emits an invalid import to a private library. #82

Closed
souenzzo opened this issue May 21, 2022 · 4 comments
Closed

valid cljd code emits an invalid import to a private library. #82

souenzzo opened this issue May 21, 2022 · 4 comments

Comments

@souenzzo
Copy link

I'm trying to run this first example of HttpServer via clojuredart
https://api.dart.dev/stable/2.17.1/dart-io/HttpServer-class.html
I wrote this code

(ns aim.main
  (:require ["dart:io" :as io]))

(defn main
  []
  (let [server (await (.bind io/HttpServer (.-anyIPv6 io/InternetAddress) 8080))]
    (.forEach server (fn [^io/HttpRequest r]
                       (.close (.-response r))
                       nil))))

When I try to dart run, it generates this error:

Failed to build aim:aim:
lib/cljd-out/aim/main.dart:5:8: Error: Can't access platform private library.
import "dart:_http" as d_http;

src:

https://github.com/souenzzo/aim

@dupuchba
Copy link
Contributor

Ok, I reproduced it - Will fix it soon

@dupuchba
Copy link
Contributor

between, to make it pass right now you can use (let [^io/HttpServer server ...

@souenzzo
Copy link
Author

This works
^io/HttpServer server (await
But this, don't
server ^io/HttpServer (await

In clojure, they are equivalent. This is a know/documented difference from clojure?

@dupuchba
Copy link
Contributor

@souenzzo it's fixed on the compiler. for type hinting it's a bug in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants