Cephelapod-compiled Kalypso will compile Kalypso, but the result segfaults

This commit is contained in:
Nathan Braswell
2016-03-26 04:39:26 -04:00
parent 7d749e7ca5
commit 1cc8fd294e
3 changed files with 79 additions and 30 deletions

View File

@@ -138,10 +138,15 @@ obj type (Object) {
return base == other.base && deref_equality(return_type, other.return_type) &&
indirection == other.indirection && deref_equality(type_def, other.type_def) && traits == other.traits
}
fun to_string(): string {
var trait_string = string(":[")
traits.for_each(fun(t: string) trait_string += t;)
trait_string += "] "
fun to_string(): string return to_string(true);
fun to_string(include_traits: bool): string {
var trait_string = string()
if (include_traits) {
trait_string = string(":[")
traits.for_each(fun(t: string) trait_string += t;)
trait_string += "] "
}
var indr_string = string("")
if (is_ref)
indr_string += " ref "
@@ -221,5 +226,17 @@ obj type (Object) {
}
return false
}
fun is_none(): bool {
match (base) {
base_type::none() return true
}
return false
}
fun is_template_type(): bool {
match (base) {
base_type::template_type() return true
}
return false
}
}