diff --git a/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java b/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java index 6e9c7a3d34..a868f04c00 100644 --- a/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java +++ b/core/src/main/java/com/ibm/wala/types/generics/TypeSignature.java @@ -44,8 +44,7 @@ public static TypeSignature make(String s) throws IllegalArgumentException { assert !s.isEmpty(); switch (s.charAt(0)) { case TypeReference.VoidTypeCode: - Assertions.UNREACHABLE(); - return null; + return BaseType.VOID; case TypeReference.BooleanTypeCode: return BaseType.BOOLEAN; case TypeReference.ByteTypeCode: diff --git a/core/src/test/java/com/ibm/wala/types/generics/MethodTypeSignatureTest.java b/core/src/test/java/com/ibm/wala/types/generics/MethodTypeSignatureTest.java index 6830779794..d5ed37349c 100644 --- a/core/src/test/java/com/ibm/wala/types/generics/MethodTypeSignatureTest.java +++ b/core/src/test/java/com/ibm/wala/types/generics/MethodTypeSignatureTest.java @@ -16,4 +16,9 @@ void getArguments() { MethodTypeSignature.make("(I)V").getArguments(), arrayContaining(is(TypeSignature.make("I")))); } + + @Test + void getVoidReturn() { + assertThat(MethodTypeSignature.make("(I)V").getReturnType(), is(TypeSignature.make("V"))); + } }