Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Commit e10164e

Browse files
committed
Resolve MSVC compilation errors.
Fixes #3
1 parent 29d2c66 commit e10164e

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.idea/
2-
cmake-build-debug/
2+
cmake-build-debug**/
33
venv/
44
**__pycache__/
55
dump/
66
.pytest_cache/
7+
78
.lbd_history
89
.direnv.ps1

‎include/lbd/type/Type.hpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <memory>
4+
#include <string>
45
#include <vector>
56
#include <lbd/type/TypeKind.hpp>
67

‎src/type/Type.cpp‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <functional>
2+
#include <ostream>
23
#include <lbd/type/Type.hpp>
34

45
namespace 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

Comments
 (0)