File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -695,8 +695,7 @@ pub fn (t &Table) type_kind(typ Type) Kind {
695
695
}
696
696
697
697
pub fn (t &Table) type_is_for_pointer_arithmetic (typ Type) bool {
698
- typ_sym := t.sym (typ)
699
- if typ_sym.kind == .struct_ {
698
+ if t.sym (typ).kind == .struct_ {
700
699
return false
701
700
} else {
702
701
return typ.is_any_kind_of_pointer () || typ.is_int_valptr ()
@@ -881,9 +880,8 @@ pub fn (t &TypeSymbol) sumtype_info() SumType {
881
880
}
882
881
883
882
pub fn (t &TypeSymbol) is_heap () bool {
884
- if t.kind == .struct_ {
885
- info := t.info as Struct
886
- return info.is_heap
883
+ if t.info is Struct {
884
+ return t.info.is_heap
887
885
} else {
888
886
return false
889
887
}
@@ -1154,10 +1152,10 @@ pub fn (t &Table) type_to_str(typ Type) string {
1154
1152
}
1155
1153
1156
1154
// type name in code (for builtin)
1157
- pub fn (mytable &Table) type_to_code (t Type) string {
1158
- match t {
1159
- ast.int_literal_type, ast.float_literal_type { return mytable .sym (t ).kind.str () }
1160
- else { return mytable .type_to_str_using_aliases (t , map [string ]string {}) }
1155
+ pub fn (t &Table) type_to_code (typ Type) string {
1156
+ match typ {
1157
+ ast.int_literal_type, ast.float_literal_type { return t .sym (typ ).kind.str () }
1158
+ else { return t .type_to_str_using_aliases (typ , map [string ]string {}) }
1161
1159
}
1162
1160
}
1163
1161
You can’t perform that action at this time.
0 commit comments