Skip to content

Commit 5830f75

Browse files
committed
Update the test for the original error
1 parent c38c2c9 commit 5830f75

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/test/resources/test-scripts/methodselection.bsh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/java bsh.Interpreter
22

33
source("TestHarness.bsh");
4+
source("Assert.bsh");
45

56
// test static method selection
67
assert( MethodSelection.get_static( (int)5 ) == Integer.TYPE );
@@ -79,6 +80,20 @@ Object x = null;
7980
String str = String.valueOf(x);
8081
assert("null".equals(str));
8182

83+
/*
84+
* Test method selection with override of array type
85+
* Related to issue #731
86+
*/
87+
method2( single ) {
88+
return single;
89+
}
90+
91+
method2( String[] list ) {
92+
return method2( list[1] );
93+
}
94+
95+
assertEquals( method2("a"), "a" );
96+
assertEquals( method2(new String[] {"a","b","c"}), "b" );
8297

8398
complete();
8499

0 commit comments

Comments
 (0)