Fix templated types getting their indirection stripped off when used
This commit is contained in:
@@ -193,7 +193,7 @@ fun transform_type(node: *tree<symbol>, scope: *ast_node, template_replacements:
|
||||
println(type_syntax_str + " *************************")
|
||||
if (template_replacements.contains_key(type_syntax_str)) {
|
||||
print("Is in template_replacements, returning: ")
|
||||
var to_ret = template_replacements[type_syntax_str]->clone_with_indirection(indirection)
|
||||
var to_ret = template_replacements[type_syntax_str]->clone_with_increased_indirection(indirection)
|
||||
println(to_ret->to_string())
|
||||
return to_ret
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ obj type (Object) {
|
||||
return string("impossible type, indirection:") + indirection
|
||||
}
|
||||
fun clone_with_increased_indirection(): *type return clone_with_indirection(indirection+1);
|
||||
fun clone_with_increased_indirection(more: int): *type return clone_with_indirection(indirection+more);
|
||||
fun clone_with_decreased_indirection(): *type return clone_with_indirection(indirection-1);
|
||||
fun clone_with_indirection(ind: int): *type {
|
||||
var to_ret = new<type>()
|
||||
|
||||
@@ -45,8 +45,11 @@ fun some_other_function(in: bool): float {
|
||||
}
|
||||
*/
|
||||
fun main(): int {
|
||||
var a = id<int>(7)
|
||||
simple_println(a)
|
||||
/*var a = id<int>(7)*/
|
||||
/*simple_println(a)*/
|
||||
/*var b = id<*char>("Double down time")*/
|
||||
/*simple_println(b)*/
|
||||
simple_println(id<*char>("Double down time"))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user