Skip to content

Commit

Permalink
test case for Float to float primitve in patterns issue#3505
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalat committed Jan 8, 2025
1 parent b79bd1d commit feca81b
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PrimitiveInPatternsTest extends AbstractRegressionTest9 {
static {
// TESTS_NUMBERS = new int [] { 1 };
// TESTS_RANGE = new int[] { 1, -1 };
// TESTS_NAMES = new String[] { "testIssuePrimitivesWithNull" };
// TESTS_NAMES = new String[] { "testIssue3505" };
}
private String extraLibPath;
public static Class<?> testClass() {
Expand Down Expand Up @@ -7386,5 +7386,30 @@ public static void main(String[] args) {
},
"Default");
}
public void testIssue3505() {
runConformTest(new String[] {
"X.java",
"""
public class X {
public static int foo() {
Y<Float> y = new Y<>();
y.value = 100f;
return y.get() instanceof float ? 1 : 0;
}
public static void main(String[] args) {
System.out.println(X.foo());
}
}
class Y<T> {
T value;
public T get() {
return this.value;
}
} """
},
"1");
}

}

0 comments on commit feca81b

Please sign in to comment.