Skip to content

Commit 37400e9

Browse files
committed
Improve getIn return type
1 parent 45c8fc6 commit 37400e9

File tree

1 file changed

+3
-2
lines changed
  • convex-core/src/main/java/convex/core/lang

1 file changed

+3
-2
lines changed

convex-core/src/main/java/convex/core/lang/RT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,8 @@ public static ACell get(ADataStructure<?> coll, ACell key) {
13911391
* @param keys Key to look up in collection
13921392
* @return Value from collection with the specified key, or null if not found / invalid path
13931393
*/
1394-
public static ACell getIn(ACell coll, Object... keys) {
1394+
@SuppressWarnings("unchecked")
1395+
public static <T extends ACell> T getIn(ACell coll, Object... keys) {
13951396
ACell result=coll;
13961397
for (int i=0; i<keys.length; i++) {
13971398
if (result instanceof ADataStructure ds) {
@@ -1401,7 +1402,7 @@ public static ACell getIn(ACell coll, Object... keys) {
14011402
return null;
14021403
}
14031404
}
1404-
return result;
1405+
return (T) result;
14051406
}
14061407

14071408
public static ACell assocIn(ACell a, ACell value, Object... keys) {

0 commit comments

Comments
 (0)