GROOVY-11896: Support module import declarations

Paul King <[email protected]>
Newsgroups gmane.comp.lang.groovy.devel
Message-ID <CAMbkE7Q9EzP+GbAYrjZJuNhhCLh_8zvf1bphG3nqN6N00RuWJw@mail.gmail.com>
Hi folks,

Just seeking feedback if anyone sees problems with the following proposal:

https://issues.apache.org/jira/browse/GROOVY-11896

https://github.com/apache/groovy/pull/2429

It adds support for module import declarations (JDK 25/JEP 511):

import module java.base
var latch = new CountDownLatch(1)

import module org.junit.jupiter.api
assert Test.name == 'org.junit.jupiter.api.Test'
assert DisabledIf.name == 'org.junit.jupiter.api.condition.DisabledIf'

Groovy 6 would support them from JDK17.

We have, in much earlier conversations, discussed following Scala's
lead and having something like an "import java.util.**" and importing
all classes and child package classes, but we never progressed the
idea, and following Java's lead here seems the way to go.

Cheers, Paul.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.