Re: RFR: 8328481: Implement Module Imports [v8]
On Thu, 18 Apr 2024 05:43:03 GMT, Alan Bateman wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fixing ListModuleDeps test. > > src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java line 84: > >> 82: @JEP(number=461, title="Stream Gatherers", status="Preview") >> 83: STREAM_GATHERERS, >> 84: @JEP(number=0, title="Module Imports", status="Preview") > > I see this has been assigned JEP 476 so I assume you can set the number for > the first integration. Done, thanks: https://github.com/openjdk/jdk/pull/18614/commits/432393abb4ac1f5c4730d982a3911284fe866318 - PR Review Comment: https://git.openjdk.org/jdk/pull/18614#discussion_r1570071215
Re: RFR: 8328481: Implement Module Imports [v8]
On Wed, 17 Apr 2024 19:33:09 GMT, Jan Lahoda wrote: >> This is an implementation of JEP JDK-8315129: Module Import Declarations >> (Preview). Please see the JEP for details: >> https://bugs.openjdk.org/browse/JDK-8315129 >> >> It is mostly straightforward - the module imports are parsed, and then >> expanded to import-on-demand in `TypeEnter`. >> There is a few notable aspects, however: >> - the AST node for import (`JCImport`) is holding the imported element as a >> field access, because so far, the imported element always had to have a '.' >> (even for import-on-demand). But for module imports, it is permissible to >> import from a module whose name does not have a dot (`import module m;`). >> The use of field access for ordinary import seems very useful, so I >> preferred to keep that, and created a new internal-only AST node for module >> imports. There is still only one public API AST node/interface, so this is >> purely an implementation choice. >> - JShell now supports module imports as well; and the default, implicit, >> script is changed to use it to import all of `java.base` if preview is >> enabled. It is expected that the default would be changed if/when the module >> imports feature is finalized. > > Jan Lahoda has updated the pull request incrementally with one additional > commit since the last revision: > > Fixing ListModuleDeps test. src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java line 84: > 82: @JEP(number=461, title="Stream Gatherers", status="Preview") > 83: STREAM_GATHERERS, > 84: @JEP(number=0, title="Module Imports", status="Preview") I see this has been assigned JEP 476 so I assume you can set the number for the first integration. - PR Review Comment: https://git.openjdk.org/jdk/pull/18614#discussion_r1570018046
Re: RFR: 8328481: Implement Module Imports [v8]
> This is an implementation of JEP JDK-8315129: Module Import Declarations > (Preview). Please see the JEP for details: > https://bugs.openjdk.org/browse/JDK-8315129 > > It is mostly straightforward - the module imports are parsed, and then > expanded to import-on-demand in `TypeEnter`. > There is a few notable aspects, however: > - the AST node for import (`JCImport`) is holding the imported element as a > field access, because so far, the imported element always had to have a '.' > (even for import-on-demand). But for module imports, it is permissible to > import from a module whose name does not have a dot (`import module m;`). The > use of field access for ordinary import seems very useful, so I preferred to > keep that, and created a new internal-only AST node for module imports. There > is still only one public API AST node/interface, so this is purely an > implementation choice. > - JShell now supports module imports as well; and the default, implicit, > script is changed to use it to import all of `java.base` if preview is > enabled. It is expected that the default would be changed if/when the module > imports feature is finalized. Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Fixing ListModuleDeps test. - Changes: - all: https://git.openjdk.org/jdk/pull/18614/files - new: https://git.openjdk.org/jdk/pull/18614/files/27f9cfb5..7fa0ad51 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk=18614=07 - incr: https://webrevs.openjdk.org/?repo=jdk=18614=06-07 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/18614.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/18614/head:pull/18614 PR: https://git.openjdk.org/jdk/pull/18614