Integrated: 8129418: JShell: better highlighting of errors in imports on demand

Nizar Benalla nbenalla at openjdk.org
Fri May 17 06:43:06 UTC 2024


On Thu, 2 May 2024 23:42:38 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

> When Type-Import-on-Demand fails, we now point the position of the first incorrect PackageOrTypeName which clearly isn't package, a class,or an interface.
> 
> old behavior:
> 
> |  Welcome to JShell -- Version 22.0.1
> |  For an introduction type: /help intro
> 
> jshell> import unknown.*;
> |  Error:
> |  package unknown does not exist
> |  import unknown.*;
> |  ^
> 
> New behavior:
> 
> |  Welcome to JShell -- Version 23-internal
> |  For an introduction type: /help intro
> 
> jshell> import unknown.*;
> |  Error:
> |  package unknown does not exist
> |  import unknown.*;
> |         ^-----^
> 
> 
> 
> jshell> import unknown.unknown.unknown.*;
> |  Error:
> |  package unknown.unknown.unknown does not exist
> |  import unknown.unknown.unknown.*;
> |         ^---------------------^

This pull request has now been integrated.

Changeset: ae999eae
Author:    Nizar Benalla <nbenalla at openjdk.org>
Committer: Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/ae999eae7e61072ad964a43f622fa930ce1179f7
Stats:     11 lines in 7 files changed: 0 ins; 1 del; 10 mod

8129418: JShell: better highlighting of errors in imports on demand

Reviewed-by: jlahoda

-------------

PR: https://git.openjdk.org/jdk/pull/19073


More information about the compiler-dev mailing list