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

Add using directive for target JVM #1510

Closed
markehammons opened this issue Oct 31, 2022 · 2 comments · Fixed by #1539
Closed

Add using directive for target JVM #1510

markehammons opened this issue Oct 31, 2022 · 2 comments · Fixed by #1539
Labels
enhancement New feature or request

Comments

@markehammons
Copy link

Is your feature request related to a problem? Please describe.
I'd like to post the following code as an example program for my project using scala-cli:

using lib "fr.hammons::slinc-runtime:0.1.1-72-1cedff"
using `jvm` "19"
using `java-opt` "--enable-native-access=ALL-UNNAMED"

import fr.hammons.slinc.runtime.{*,given}

case class div_t(quot: CInt, rem: CInt) derives Struct

object MyLib derives Library:
  def abs(i: CInt): CInt = Library.binding
  def div(numer: CInt, denom: CInt): div_t = Library.binding

@main def program =
  println(MyLib.abs(-5)) // prints 5
  println(MyLib.div(5,2)) // prints div_t(2,1)

The jvm directive would be helpful because the option set here is java 19 specific.

Describe the solution you'd like
Allow the already existing jvm download feature to be applied via a using directive.

@markehammons markehammons added the enhancement New feature or request label Oct 31, 2022
@lrytz
Copy link

lrytz commented Nov 4, 2022

duplicate of #1337

@lwronski
Copy link
Contributor

lwronski commented Nov 7, 2022

Thanks for reporting, it should be added in the next version of Scala CLI 0.1.17.

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

Successfully merging a pull request may close this issue.

3 participants