StructDefinitionType extends UnqualifiedType { @Override public boolean hasCanonicalConstant(Scope scope) { return hasStructNameType() && fieldTypes .stream() .allMatch(item -> item.hasCanonicalConstant(scope)); } StructDefinitionType(Optional<StructNameType> structNameType,
                               List<String> fieldNames,
                               List<Type> fieldTypes);  StructDefinitionType(StructNameType structNameType,
                              List<String> fieldNames,
                              List<Type> fieldTypes); boolean hasStructNameType(); StructNameType getStructNameType(); List<String> getFieldNames(); List<Type> getFieldTypes(); Type getFieldType(String name); Type getFieldType(int index); String getFieldName(int index); int getNumFields(); void insertField(int index, String name, Type type); void removeField(String fieldToRemove); void setFieldName(int index, String fieldName); void setFieldType(int index, Type type); int getFieldIndex(String fieldToRemove); boolean hasField(String nameToCheck); @Override void accept(IAstVisitor visitor); @Override StructDefinitionType clone(); @Override boolean hasCanonicalConstant(Scope scope); @Override Expr getCanonicalConstant(Scope scope); @Override boolean equals(Object that); @Override int hashCode();  }
@Test public void hasCanonicalConstant() { StructDefinitionType t = new StructDefinitionType(new StructNameType("astruct"), Arrays.asList("x", "y"), Arrays.asList(BasicType.MAT4X4, BasicType.VEC4)); assertTrue(t.hasCanonicalConstant(new Scope())); assertEquals("astruct(mat4(1.0), vec4(1.0))", t.getCanonicalConstant(new Scope()).getText()); }