in ,

Support JEP-261 Module System · Issue # 529 · scala / scala-dev, Hacker News

Support JEP-261 Module System · Issue # 529 · scala / scala-dev, Hacker News


          

(Part of the epic,#)

  • Expose new command line options toscalac( and later to thescalascript runner) (- module-path, etc)
  • Build atopStandardJavaFileManagerandjava. lang.module ._, to process these options and create aClassPathimplementation and resolved module graph
  • UpdateContext.isAccessibleto check for reads / exports edges between the call site and referenced symbol.
  • To support mixed compilation, add a parser formodule-info.java, and feed a descriptor of the module descriptor to the module graph configuration.

WIP:https://github.com/retronym/scala/tree/ topic / jpms

% qscalac -nobootcp -modulepath "" $ (f "class C {def foo=javax.xml.bind .DatatypeConverter.printBase 64 Binary _} ") /tmp/a.scala:1: error: object DatatypeConverter is not a member of package javax.xml.bind class C {def foo=javax.xml.bind.DatatypeConverter.printBase 64 Binary _}                                    ^ one error found  % qscalac -nobootcp -modulepath "" -addmodules: java.xml.bind $ (f "class C {def foo=javax.xml.bind.DatatypeConverter.printBase 64 Binary _} ")  % qscalac -nobootcp -modulepath "" $ (f "class C {sun.reflect.misc.ConstructorUtil.getConstructors (null)}" ") /tmp/a.scala:1: error: class ConstructorUtil in package misc cannot be accessed in package sun.reflect.misc class C {sun.reflect.misc.ConstructorUtil.getConstructors (null)}                            ^ one error found  % qscalac -nobootcp -modulepath "" -addexports: java.base / sun.reflect.misc=ALL-UNNAMED $ (f "class C {sun.reflect.misc.ConstructorUtil.getConstructors (null)}" ")

Non Goals

Support for- module-source-path. A batch of source files will be associated with at most one module.

Open Issues

How should we structure our build to allow us to call Java 9 APIs from this code path? I’m thinking we do this from a small pure-Java project and incorporate the results intoscala-reflect.jar, similar to how we’ve dealt withscala-asm.

      

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published.

GIPHY App Key not set. Please check settings

eToro Senior Analyst Mati Greenspan's 3 Favorite Crypto Picks – CCN Markets, Crypto Coins News

eToro Senior Analyst Mati Greenspan's 3 Favorite Crypto Picks – CCN Markets, Crypto Coins News

SECURITY: Report reveals play-by-play of first U.S. grid cyberattack, Hacker News

SECURITY: Report reveals play-by-play of first U.S. grid cyberattack, Hacker News