Remove ArrayBase

This is the only place we really make copies of types. Removing it to
make it easier to avoid copy constructors to make it easier to add
invariants to the compiler.

Bug: 201584220
Test: aidl_unittests
Change-Id: I1898e7eeed866b3b175fcecc87a395ec701f75c8
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
index b97889d..3ec6d47 100644
--- a/aidl_const_expressions.cpp
+++ b/aidl_const_expressions.cpp
@@ -549,8 +549,11 @@
       bool success = true;
 
       for (const auto& value : values_) {
-        const AidlTypeSpecifier& array_base = type.ArrayBase();
-        const string value_string = value->ValueString(array_base, decorator);
+        string value_string;
+        type.ViewAsArrayBase([&](const AidlTypeSpecifier& base) {
+          value_string = value->ValueString(base, decorator);
+        });
+
         if (value_string.empty()) {
           success = false;
           break;