+ this.environment = environment;
+ if (type instanceof UnresolvedReferenceBinding)
+ ((UnresolvedReferenceBinding) type).addWrapper(this);
+ else
+ this.tagBits |= type.tagBits & (HasTypeVariable | HasDirectWildcard);
+}
+
+public int kind() {
+ return ARRAY_TYPE;
+}
+
+/**
+ * Collect the substitutes into a map for certain type variables inside the receiver type
+ * e.g. Collection<T>.findSubstitute(T, Collection<List<X>>): T --> List<X>
+ */
+public void collectSubstitutes(TypeBinding otherType, Map substitutes) {
+ if (otherType.isArrayType()) {
+ int otherDim = otherType.dimensions();
+ if (otherDim == this.dimensions) {
+ this.leafComponentType.collectSubstitutes(otherType.leafComponentType(), substitutes);
+ } else if (otherDim > this.dimensions) {
+ ArrayBinding otherReducedType = this.environment.createArrayType(otherType.leafComponentType(), otherDim - this.dimensions);
+ this.leafComponentType.collectSubstitutes(otherReducedType, substitutes);
+ }
+ }