Commit 5e756211 authored by Jürg Billeter's avatar Jürg Billeter

Fix type resolution with derived integer types

parent 58b40d21
...@@ -255,6 +255,23 @@ public class Vala.SymbolResolver : CodeVisitor { ...@@ -255,6 +255,23 @@ public class Vala.SymbolResolver : CodeVisitor {
} }
} }
DataType get_type_for_struct (Struct st, Struct base_struct) {
if (base_struct.base_struct != null) {
return get_type_for_struct (st, base_struct.base_struct);
}
// attributes are not processed yet, access them directly
if (base_struct.get_attribute ("BooleanType") != null) {
return new BooleanType (st);
} else if (base_struct.get_attribute ("IntegerType") != null) {
return new IntegerType (st);
} else if (base_struct.get_attribute ("FloatingType") != null) {
return new FloatingType (st);
} else {
return new StructValueType (st);
}
}
private DataType resolve_type (UnresolvedType unresolved_type) { private DataType resolve_type (UnresolvedType unresolved_type) {
DataType type = null; DataType type = null;
...@@ -287,17 +304,7 @@ public class Vala.SymbolResolver : CodeVisitor { ...@@ -287,17 +304,7 @@ public class Vala.SymbolResolver : CodeVisitor {
} else if (sym is Interface) { } else if (sym is Interface) {
type = new ObjectType ((Interface) sym); type = new ObjectType ((Interface) sym);
} else if (sym is Struct) { } else if (sym is Struct) {
var st = (Struct) sym; type = get_type_for_struct ((Struct) sym, (Struct) sym);
// attributes are not processed yet, access them directly
if (st.get_attribute ("BooleanType") != null) {
type = new BooleanType (st);
} else if (st.get_attribute ("IntegerType") != null) {
type = new IntegerType (st);
} else if (st.get_attribute ("FloatingType") != null) {
type = new FloatingType (st);
} else {
type = new StructValueType (st);
}
} else if (sym is Enum) { } else if (sym is Enum) {
type = new EnumValueType ((Enum) sym); type = new EnumValueType ((Enum) sym);
} else if (sym is ErrorDomain) { } else if (sym is ErrorDomain) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment