Fix CcCompilationInfo to appropriately subclass Struct, and improve upon error messaging and commenting when there's an unresolvable skylark type.

RELNOTES: None.
PiperOrigin-RevId: 203826504
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcCompilationInfoApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcCompilationInfoApi.java
index ca6176a..127ebaa 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcCompilationInfoApi.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcCompilationInfoApi.java
@@ -14,17 +14,14 @@
 
 package com.google.devtools.build.lib.skylarkbuildapi.cpp;
 
+import com.google.devtools.build.lib.skylarkbuildapi.StructApi;
 import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
 import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
 
-/**
- * Interface for a wrapper of every C++ compilation provider.
- */
+/** Interface for a wrapper of every C++ compilation provider. */
 @SkylarkModule(
     name = "cc_compilation_info",
     documented = false,
     category = SkylarkModuleCategory.PROVIDER,
-    doc = "Wrapper for every C++ compilation provider"
-)
-public interface CcCompilationInfoApi {
-}
+    doc = "Wrapper for every C++ compilation provider")
+public interface CcCompilationInfoApi extends StructApi {}
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkInterfaceUtils.java b/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkInterfaceUtils.java
index 3f25c32..a4279e4b 100644
--- a/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkInterfaceUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkInterfaceUtils.java
@@ -58,8 +58,17 @@
     } else if (yClass.isAssignableFrom(xClass)) {
       return x;
     } else {
+      // If this exception occurs, it indicates the following error scenario:
+      //
+      // Suppose class A is a subclass of both B and C, where B and C are annotated with
+      // @SkylarkModule annotations (and are thus considered "skylark types"). If B is not a
+      // subclass of C (nor visa versa), then it's impossible to resolve whether A is of type
+      // B or if A is of type C. It's both! The way to resolve this is usually to have A be its own
+      // type (annotated with @SkylarkModule), and thus have the explicit type of A be semantically
+      // "B and C".
+      // TODO(cparsons): Verify in a test, and thus not rely solely on a runtime check.
       throw new IllegalArgumentException(String.format(
-          "Expected one of %s and %s to be assignable to each other",
+          "Expected one of %s and %s to be a subclass of the other",
           xClass, yClass));
     }
   }