mirror of
https://github.com/vim/vim
synced 2025-05-02 22:37:47 +02:00
Some checks failed
GitHub CI / linux (arm64, gcc, [nogui], tiny) (push) Has been cancelled
GitHub CI / linux (arm64, gcc, true, [unittests], huge) (push) Has been cancelled
GitHub CI / linux (clang, [asan], huge, 5.1) (push) Has been cancelled
GitHub CI / linux (clang, [nogui], tiny) (push) Has been cancelled
GitHub CI / linux (gcc, [nogui], tiny) (push) Has been cancelled
GitHub CI / linux (gcc, [vimtags], normal) (push) Has been cancelled
GitHub CI / linux (gcc, true, [uchar testgui], huge, dynamic) (push) Has been cancelled
GitHub CI / linux (gcc, true, [unittests], huge) (push) Has been cancelled
GitHub CI / linux (i386, gcc, normal, ./src/shadow) (push) Has been cancelled
GitHub CI / linux (native, clang, [], normal) (push) Has been cancelled
GitHub CI / linux (native, clang, [], tiny) (push) Has been cancelled
GitHub CI / linux (native, clang, true, [], huge, dynamic, stable-abi) (push) Has been cancelled
GitHub CI / linux (native, gcc, [], normal) (push) Has been cancelled
GitHub CI / linux (native, gcc, [], tiny) (push) Has been cancelled
GitHub CI / linux (native, gcc, true, [], huge) (push) Has been cancelled
GitHub CI / macos (huge, macos-13) (push) Has been cancelled
GitHub CI / macos (huge, macos-15) (push) Has been cancelled
GitHub CI / macos (normal, macos-13) (push) Has been cancelled
GitHub CI / macos (normal, macos-15) (push) Has been cancelled
GitHub CI / macos (tiny, macos-13) (push) Has been cancelled
GitHub CI / macos (tiny, macos-15) (push) Has been cancelled
GitHub CI / windows (no, no, x64, HUGE, stable, msvc) (push) Has been cancelled
GitHub CI / windows (no, no, x86, TINY, mingw) (push) Has been cancelled
GitHub CI / windows (no, yes, x64, yes, HUGE, mingw) (push) Has been cancelled
GitHub CI / windows (no, yes, x86, NORMAL, msvc) (push) Has been cancelled
GitHub CI / windows (yes, no, x64, NORMAL, mingw) (push) Has been cancelled
GitHub CI / windows (yes, no, x86, HUGE, msvc) (push) Has been cancelled
GitHub CI / windows (yes, yes, x64, TINY, msvc) (push) Has been cancelled
GitHub CI / windows (yes, yes, x86, yes, HUGE, stable, mingw) (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
- "Demote" SecurityManager from the list of java.lang class types to javaLangDeprecated. - Reintroduce supported syntax-preview-feature numbers 455 and 476 as _new numbers_ 488 and 494, respectively. References: - https://openjdk.org/jeps/486 (Permanently Disable the Security Manager) - https://openjdk.org/jeps/488 (Primitive Types in Patterns etc.) - https://openjdk.org/jeps/494 (Module Import Declarations) closes: #16977 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
64 lines
1.1 KiB
Java
64 lines
1.1 KiB
Java
// VIM_TEST_SETUP let g:java_syntax_previews = [455, 488]
|
|
|
|
|
|
|
|
class PrimitiveSwitchTests // JDK 23+ (--enable-preview --release 23).
|
|
{
|
|
static void echo(Object o) { System.out.println(o); }
|
|
|
|
static {
|
|
long g = 2L;
|
|
|
|
switch (g) {
|
|
case 0L: { echo(0L); break; }
|
|
case 1L: { echo(1L); break; }
|
|
default: { echo(-1L); break; }
|
|
}
|
|
|
|
echo(switch (g) {
|
|
case 0L -> 0L;
|
|
case 1L -> 1L;
|
|
default -> -1L;
|
|
});
|
|
|
|
boolean bool = false;
|
|
|
|
switch (bool) {
|
|
case true: { echo(true); break; }
|
|
case false: { echo(false); break; }
|
|
}
|
|
|
|
echo(switch (bool) {
|
|
case true -> true;
|
|
case false -> false;
|
|
});
|
|
|
|
float f = 2.0f;
|
|
|
|
switch (f) {
|
|
case 0.0f: { echo(0.0f); break; }
|
|
case 1.0f: { echo(1.0f); break; }
|
|
default: { echo(-1.0f); break; }
|
|
}
|
|
|
|
echo(switch (f) {
|
|
case 0.0f -> 0.0f;
|
|
case 1.0f -> 1.0f;
|
|
default -> -1.0f;
|
|
});
|
|
|
|
double d = 2.0;
|
|
|
|
switch (d) {
|
|
case 0.0: { echo(0.0); break; }
|
|
case 1.0: { echo(1.0); break; }
|
|
default: { echo(-1.0); break; }
|
|
}
|
|
|
|
echo(switch (d) {
|
|
case 0.0 -> 0.0;
|
|
case 1.0 -> 1.0;
|
|
default -> -1.0;
|
|
});
|
|
}
|
|
}
|