fuzz: `void` is an invalid type for parameters

Bug: 190840081
Test: m aidl_unittests
Change-Id: I4d97d51ac67bf56bcf729c2397f1d8b1fbe20c23
diff --git a/aidl_unittest.cpp b/aidl_unittest.cpp
index b3e07bd..e2a37ac 100644
--- a/aidl_unittest.cpp
+++ b/aidl_unittest.cpp
@@ -4071,6 +4071,14 @@
   EXPECT_THAT(GetCapturedStderr(), HasSubstr("@SuppressWarnings is not available"));
 }
 
+TEST_F(AidlTest, VoidCantBeUsedInMethodParameterType) {
+  io_delegate_.SetFileContents("p/IFoo.aidl", "interface IFoo{ void j(void n);}");
+  auto options = Options::From("aidl --lang=java -o out p/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_EQ(1, aidl::compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("'void' is an invalid type for the parameter 'n'"));
+}
+
 struct TypeParam {
   string kind;
   string literal;