@@ -21,7 +21,7 @@ pub struct TypeSym < Sym {
21
21
pub mut align: uint;
22
22
pub mut default_value: ?+Expr;
23
23
24
- pub func lookup_field(self, name: string) -> ?Field {
24
+ pub func lookup_field(+ self, name: string) -> ?Field {
25
25
for f in self.fields {
26
26
if f.name == name {
27
27
return f;
@@ -49,20 +49,20 @@ pub struct TypeSym < Sym {
49
49
}
50
50
51
51
#[inline]
52
- pub func has_field(self, name: string) -> bool {
52
+ pub func has_field(+ self, name: string) -> bool {
53
53
return self.lookup_field(name) != none;
54
54
}
55
55
56
56
#[inline]
57
- pub func lookup(self, name: string) -> ?Sym {
57
+ pub func lookup(+ self, name: string) -> ?Sym {
58
58
return if s := self.scope.lookup(name) {
59
59
s
60
60
} else {
61
61
none
62
62
};
63
63
}
64
64
65
- pub func find_in_base(self, name: string) -> ?Sym {
65
+ pub func find_in_base(+ self, name: string) -> ?Sym {
66
66
if self.info is .Trait(trait_info) {
67
67
for b in trait_info.bases {
68
68
if s := b.scope.find(name) {
@@ -91,7 +91,7 @@ pub struct TypeSym < Sym {
91
91
}
92
92
93
93
#[inline]
94
- pub func find_func(self, name: string) -> ?+Func {
94
+ pub func find_func(+ self, name: string) -> ?+Func {
95
95
return if sym := self.scope.find(name); sym is Func(func_) {
96
96
if self.info !is .Trait && !func_.has_body {
97
97
return none;
@@ -108,7 +108,7 @@ pub struct TypeSym < Sym {
108
108
}
109
109
110
110
#[inline]
111
- pub func find_method(self, name: string) -> ?+Func {
111
+ pub func find_method(+ self, name: string) -> ?+Func {
112
112
return if func_ := self.find_func(name); func_.is_method {
113
113
func_
114
114
} else {
@@ -117,16 +117,16 @@ pub struct TypeSym < Sym {
117
117
}
118
118
119
119
#[inline]
120
- pub func has_func(self, name: string) -> bool {
120
+ pub func has_func(+ self, name: string) -> bool {
121
121
return self.find_func(name) != none;
122
122
}
123
123
124
124
#[inline]
125
- pub func has_method(self, name: string) -> bool {
125
+ pub func has_method(+ self, name: string) -> bool {
126
126
return self.find_method(name) != none;
127
127
}
128
128
129
- pub func full_fields(mut self) -> []Field {
129
+ pub func full_fields(+ mut self) -> []Field {
130
130
if !self.full_fields_.is_empty() {
131
131
return self.full_fields_;
132
132
}
@@ -157,15 +157,15 @@ pub struct TypeSym < Sym {
157
157
}
158
158
159
159
#[inline]
160
- pub func implement_trait(self, trait_sym: +TypeSym) -> bool {
160
+ pub func implement_trait(+ self, trait_sym: +TypeSym) -> bool {
161
161
return if trait_sym.info is .Trait(trait_info) {
162
162
self in trait_info.implements
163
163
} else {
164
164
false
165
165
};
166
166
}
167
167
168
- pub func update(mut self, other: +TypeSym) -> !bool {
168
+ pub func update(+ mut self, other: +TypeSym) -> !bool {
169
169
if self.info is .Placeholder {
170
170
// update placeholder
171
171
if other.info !is .Placeholder {
@@ -182,7 +182,7 @@ pub struct TypeSym < Sym {
182
182
}
183
183
184
184
#[inline]
185
- pub func is_boxed(self) -> bool {
185
+ pub func is_boxed(+ self) -> bool {
186
186
return match self.info {
187
187
.Trait -> true,
188
188
.Struct(struct_info) -> struct_info.is_boxed,
@@ -192,17 +192,17 @@ pub struct TypeSym < Sym {
192
192
}
193
193
194
194
#[inline]
195
- pub func is_primitive(self) -> bool {
195
+ pub func is_primitive(+ self) -> bool {
196
196
return self.info.is_primitive();
197
197
}
198
198
199
199
#[inline]
200
- pub func ==(self, rhs: Self) -> bool {
200
+ pub func ==(+ self, rhs: + Self) -> bool {
201
201
return self.id == rhs.id;
202
202
}
203
203
204
204
#[inline]
205
- pub func !=(self, rhs: Self) -> bool {
205
+ pub func !=(+ self, rhs: + Self) -> bool {
206
206
return self.id != rhs.id;
207
207
}
208
208
}
0 commit comments