GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 3 / 0 / 3
Functions: 100.0% 2 / 0 / 2
Branches: 50.0% 2 / 0 / 4

src/model/GenericType.h
Line Branch Exec Source
1 // Copyright (c) 2021-2026 ChilliBits. All rights reserved.
2
3 #pragma once
4
5 #include <string>
6 #include <unordered_map>
7 #include <utility>
8
9 #include <symboltablebuilder/QualType.h>
10 #include <symboltablebuilder/TypeChain.h>
11
12 namespace spice::compiler {
13
14 class GenericType : public QualType {
15 public:
16 // Constructors
17
2/4
✓ Branch 2 → 3 taken 50158 times.
✗ Branch 2 → 11 not taken.
✓ Branch 5 → 6 taken 50158 times.
✗ Branch 5 → 8 not taken.
150474 explicit GenericType(const QualType &type) : QualType(type) {}
18 4675 GenericType(const std::string &name, QualTypeList typeConditions)
19 9350 : QualType(TY_GENERIC, name), typeConditions(std::move(typeConditions)) {}
20
21 // Public methods
22 [[nodiscard]] bool checkConditionsOf(const QualType &requestedType, QualType &substantiation, bool ignoreArraySize = false,
23 bool ignoreQualifiers = false) const;
24
25 // Public members
26 bool used = false;
27
28 private:
29 // Members
30 QualTypeList typeConditions = {QualType(TY_DYN)};
31
32 // Private methods
33 [[nodiscard]] bool checkTypeConditionOf(const QualType &requestedType, QualType &substantiation, bool ignoreArraySize,
34 bool ignoreQualifiers) const;
35 };
36
37 } // namespace spice::compiler
38