11#include < functional>
2+ #include < ostream>
23#include < lbd/type/Type.hpp>
34
45namespace lbd ::type
@@ -188,61 +189,61 @@ namespace lbd::type
188189 return hash;
189190 }
190191
191- std::ostream &operator <<(std::ostream &os , const Type &type) noexcept
192+ std::ostream &operator <<(std::ostream &outputStream , const Type &type) noexcept
192193 {
193194 switch (type.kind )
194195 {
195196 case TypeKind::ANY :
196- os << " Any" ;
197+ outputStream << " Any" ;
197198 break ;
198199
199200 case TypeKind::NAMED :
200201 case TypeKind::VARIABLE :
201- os << type.name ;
202+ outputStream << type.name ;
202203 break ;
203204
204205 case TypeKind::APPLIED :
205206 {
206- os << *type.base << " <" ;
207+ outputStream << *type.base << " <" ;
207208 for (size_t i = 0 ; i < type.arguments .size (); ++i)
208209 {
209- if (i) os << " , " ;
210+ if (i) outputStream << " , " ;
210211
211212 // Parenthesize if the argument is a function.
212213 if (type.arguments [i]->getKind () == TypeKind::FUNCTION )
213- os << " (" << *type.arguments [i] << " )" ;
214+ outputStream << " (" << *type.arguments [i] << " )" ;
214215 else
215- os << *type.arguments [i];
216+ outputStream << *type.arguments [i];
216217 }
217- os << " >" ;
218+ outputStream << " >" ;
218219 break ;
219220 }
220221
221222 case TypeKind::FUNCTION :
222223 {
223224 // Parenthesize left side if it's also a function.
224225 if (type.from ->getKind () == TypeKind::FUNCTION )
225- os << " (" << *type.from << " )" ;
226+ outputStream << " (" << *type.from << " )" ;
226227 else
227- os << *type.from ;
228+ outputStream << *type.from ;
228229
229- os << " -> " ;
230- os << *type.to ;
230+ outputStream << " -> " ;
231+ outputStream << *type.to ;
231232 break ;
232233 }
233234
234235 case TypeKind::QUALIFIED :
235236 {
236237 for (size_t i = 0 ; i < type.constraints .size (); ++i)
237238 {
238- if (i) os << " , " ;
239- os << type.constraints [i].className << " " << *type.constraints [i].type ;
239+ if (i) outputStream << " , " ;
240+ outputStream << type.constraints [i].className << " " << *type.constraints [i].type ;
240241 }
241- os << " => " << *type.qualifiedType ;
242+ outputStream << " => " << *type.qualifiedType ;
242243 break ;
243244 }
244245 }
245246
246- return os ;
247+ return outputStream ;
247248 }
248- }
249+ }
0 commit comments