Commit 87e49f5f authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Implement is_subtype_of method so that structs are considered compatible

2008-06-13  Jürg Billeter  <j@bitron.ch>

	* vala/valastruct.vala:

	Implement is_subtype_of method so that structs are considered
	compatible to the specified base type

svn path=/trunk/; revision=1575
parent 61985d37
2008-06-13 Jürg Billeter <j@bitron.ch>
* vala/valastruct.vala:
Implement is_subtype_of method so that structs are considered
compatible to the specified base type
2008-06-12 Jürg Billeter <j@bitron.ch>
* vala/valatypeparametertype.vala:
......
......@@ -532,4 +532,18 @@ public class Vala.Struct : TypeSymbol {
}
}
}
public override bool is_subtype_of (TypeSymbol t) {
if (this == t) {
return true;
}
foreach (DataType base_type in base_types) {
if (base_type.data_type != null && base_type.data_type.is_subtype_of (t)) {
return true;
}
}
return false;
}
}
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