Disallow interface types in structs, unions, arrays and vectors.

Change-Id: I8964fa9bf64a3b240453d6711f9cc319883c5b0d
diff --git a/hidl-gen_y.yy b/hidl-gen_y.yy
index 7fec3b8..92767de 100644
--- a/hidl-gen_y.yy
+++ b/hidl-gen_y.yy
@@ -490,8 +490,24 @@
 
 type
     : fqname { $$ = $1; }
-    | fqname '[' INTEGER ']' { $$ = new ArrayType($1, $3); }
-    | VEC '<' fqname '>' { $$ = new VectorType($3); }
+    | fqname '[' INTEGER ']'
+      {
+          if ($1->isInterface()) {
+              fprintf(stderr, "Arrays of interface types are not supported.");
+              YYERROR;
+          }
+
+          $$ = new ArrayType($1, $3);
+      }
+    | VEC '<' fqname '>'
+      {
+          if ($3->isInterface()) {
+              fprintf(stderr, "Vectors of interface types are not supported.");
+              YYERROR;
+          }
+
+          $$ = new VectorType($3);
+      }
     | struct_or_union_declaration { $$ = $1; }
     | enum_declaration { $$ = $1; }
     ;