GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 132 / 0 / 132
Functions: 100.0% 4 / 0 / 4
Branches: 65.9% 162 / 0 / 246

src/typechecker/TypeCheckerTopLevelDefinitionsCheck.cpp
Line Branch Exec Source
1 // Copyright (c) 2021-2026 ChilliBits. All rights reserved.
2
3 #include "TypeChecker.h"
4
5 #include <SourceFile.h>
6 #include <ast/ASTNodes.h>
7 #include <exception/SemanticError.h>
8 #include <model/Interface.h>
9 #include <symboltablebuilder/Scope.h>
10 #include <symboltablebuilder/SymbolTableBuilder.h>
11 #include <typechecker/FunctionManager.h>
12 #include <typechecker/TypeMatcher.h>
13
14 namespace spice::compiler {
15
16 519 std::any TypeChecker::visitMainFctDefCheck(MainFctDefNode *node) {
17 // Skip if already type-checked
18
2/2
✓ Branch 2 → 3 taken 61 times.
✓ Branch 2 → 6 taken 458 times.
519 if (typeCheckedMainFct)
19
1/2
✓ Branch 3 → 4 taken 61 times.
✗ Branch 3 → 13 not taken.
122 return nullptr;
20
21 458 node->resizeToNumberOfManifestations(1);
22
23 // Change to function body scope
24 458 currentScope = node->bodyScope;
25 // Visit statements in new scope
26
2/2
✓ Branch 7 → 8 taken 428 times.
✓ Branch 7 → 14 taken 30 times.
458 visit(node->body);
27 // Leave main function body scope
28 428 currentScope = rootScope;
29
30 // Set to type-checked
31 428 typeCheckedMainFct = true;
32
1/2
✓ Branch 9 → 10 taken 428 times.
✗ Branch 9 → 15 not taken.
856 return nullptr;
33 }
34
35 27263 std::any TypeChecker::visitFctDefCheck(FctDefNode *node) {
36 27263 node->resizeToNumberOfManifestations(node->manifestations.size());
37 27263 manIdx = 0; // Reset the manifestation index
38
39 // Get all manifestations for this function definition
40
2/2
✓ Branch 56 → 6 taken 35671 times.
✓ Branch 56 → 57 taken 27261 times.
90195 for (Function *manifestation : node->manifestations) {
41 // Skip non-substantiated or already checked functions
42
7/8
✓ Branch 8 → 9 taken 35671 times.
✗ Branch 8 → 72 not taken.
✓ Branch 9 → 10 taken 27780 times.
✓ Branch 9 → 11 taken 7891 times.
✓ Branch 10 → 11 taken 14824 times.
✓ Branch 10 → 12 taken 12956 times.
✓ Branch 13 → 14 taken 22715 times.
✓ Branch 13 → 15 taken 12956 times.
35671 if (!manifestation->isFullySubstantiated() || manifestation->alreadyTypeChecked) {
43 22715 manIdx++; // Increase the manifestation index
44 22715 continue;
45 }
46
47 // Change scope to concrete struct specialization scope
48
2/2
✓ Branch 15 → 16 taken 6342 times.
✓ Branch 15 → 21 taken 6614 times.
12956 if (node->isMethod) {
49
2/4
✓ Branch 16 → 17 taken 6342 times.
✗ Branch 16 → 63 not taken.
✓ Branch 17 → 18 taken 6342 times.
✗ Branch 17 → 63 not taken.
6342 const std::string &scopeName = Struct::getScopeName(node->name->structName, manifestation->thisType.getTemplateTypes());
50
1/2
✓ Branch 18 → 19 taken 6342 times.
✗ Branch 18 → 61 not taken.
6342 changeToScope(scopeName, ScopeType::STRUCT);
51 6342 }
52
53 // Change to function scope
54
1/2
✓ Branch 21 → 22 taken 12956 times.
✗ Branch 21 → 72 not taken.
12956 changeToScope(manifestation->bodyScope, ScopeType::FUNC_PROC_BODY);
55
56 // Mount type mapping for this manifestation
57
1/2
✗ Branch 23 → 24 not taken.
✓ Branch 23 → 25 taken 12956 times.
12956 assert(typeMapping.empty());
58
1/2
✓ Branch 25 → 26 taken 12956 times.
✗ Branch 25 → 72 not taken.
12956 typeMapping = manifestation->typeMapping;
59
60 // Set return type to the result variable
61
1/2
✓ Branch 28 → 29 taken 12956 times.
✗ Branch 28 → 66 not taken.
38868 SymbolTableEntry *resultVarEntry = currentScope->lookupStrict(RETURN_VARIABLE_NAME);
62
1/2
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 12956 times.
12956 assert(resultVarEntry != nullptr);
63
1/2
✓ Branch 36 → 37 taken 12956 times.
✗ Branch 36 → 72 not taken.
12956 resultVarEntry->updateType(manifestation->returnType, false);
64 12956 resultVarEntry->used = true;
65
66 // Visit parameters
67 // This happens once in the type checker prepare stage. This second time is only required if we have a generic function
68
2/2
✓ Branch 37 → 38 taken 9570 times.
✓ Branch 37 → 41 taken 3386 times.
12956 if (node->hasParams)
69
1/2
✓ Branch 38 → 39 taken 9570 times.
✗ Branch 38 → 70 not taken.
9570 visit(node->paramLst);
70
71 // Visit statements in new scope
72
2/2
✓ Branch 41 → 42 taken 12954 times.
✓ Branch 41 → 71 taken 2 times.
12956 visit(node->body);
73
74 // Clear type mapping
75 12954 typeMapping.clear();
76
77 // Change to root scope
78 12954 currentScope = rootScope;
79
1/2
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 46 taken 12954 times.
12954 assert(currentScope->type == ScopeType::GLOBAL);
80
81 // Do not type-check this manifestation again
82 12954 manifestation->alreadyTypeChecked = true;
83
84 12954 manIdx++; // Increase the manifestation index
85 }
86 27261 manIdx = 0; // Reset the manifestation index
87
88
1/2
✓ Branch 57 → 58 taken 27261 times.
✗ Branch 57 → 73 not taken.
54522 return nullptr;
89 }
90
91 15166 std::any TypeChecker::visitProcDefCheck(ProcDefNode *node) {
92 15166 node->resizeToNumberOfManifestations(node->manifestations.size());
93 15166 manIdx = 0; // Reset the manifestation index
94
95 // Get all manifestations for this procedure definition
96
2/2
✓ Branch 49 → 6 taken 20765 times.
✓ Branch 49 → 50 taken 15166 times.
51097 for (Function *manifestation : node->manifestations) {
97 // Skip non-substantiated or already checked procedures
98
7/8
✓ Branch 8 → 9 taken 20765 times.
✗ Branch 8 → 59 not taken.
✓ Branch 9 → 10 taken 12520 times.
✓ Branch 9 → 11 taken 8245 times.
✓ Branch 10 → 11 taken 5987 times.
✓ Branch 10 → 12 taken 6533 times.
✓ Branch 13 → 14 taken 14232 times.
✓ Branch 13 → 15 taken 6533 times.
20765 if (!manifestation->isFullySubstantiated() || manifestation->alreadyTypeChecked) {
99 14232 manIdx++; // Increase the manifestation index
100 14232 continue;
101 }
102
103 // Change scope to concrete struct specialization scope
104
2/2
✓ Branch 15 → 16 taken 5213 times.
✓ Branch 15 → 21 taken 1320 times.
6533 if (node->isMethod) {
105
2/4
✓ Branch 16 → 17 taken 5213 times.
✗ Branch 16 → 56 not taken.
✓ Branch 17 → 18 taken 5213 times.
✗ Branch 17 → 56 not taken.
5213 const std::string &scopeName = Struct::getScopeName(node->name->structName, manifestation->thisType.getTemplateTypes());
106
1/2
✓ Branch 18 → 19 taken 5213 times.
✗ Branch 18 → 54 not taken.
5213 changeToScope(scopeName, ScopeType::STRUCT);
107 5213 }
108
109 // Change to procedure scope
110
1/2
✓ Branch 21 → 22 taken 6533 times.
✗ Branch 21 → 59 not taken.
6533 changeToScope(manifestation->bodyScope, ScopeType::FUNC_PROC_BODY);
111
112 // Mount type mapping for this manifestation
113
1/2
✗ Branch 23 → 24 not taken.
✓ Branch 23 → 25 taken 6533 times.
6533 assert(typeMapping.empty());
114
1/2
✓ Branch 25 → 26 taken 6533 times.
✗ Branch 25 → 59 not taken.
6533 typeMapping = manifestation->typeMapping;
115
116 // Visit parameters
117 // This happens once in the type checker prepare stage. This second time is only required if we have a generic procedure
118
2/2
✓ Branch 26 → 27 taken 4956 times.
✓ Branch 26 → 30 taken 1577 times.
6533 if (node->hasParams)
119
1/2
✓ Branch 27 → 28 taken 4956 times.
✗ Branch 27 → 57 not taken.
4956 visit(node->paramLst);
120
121 // Prepare generation of special ctor preamble to store VTable, default field values, etc. if required
122
2/2
✓ Branch 30 → 31 taken 2700 times.
✓ Branch 30 → 32 taken 3833 times.
6533 if (node->isCtor)
123
1/2
✓ Branch 31 → 32 taken 2700 times.
✗ Branch 31 → 59 not taken.
2700 createCtorBodyPreamble(node->scope);
124
125 // Visit statements in new scope
126
1/2
✓ Branch 32 → 33 taken 6533 times.
✗ Branch 32 → 58 not taken.
6533 visit(node->body);
127
128 // Clear type mapping
129 6533 typeMapping.clear();
130
131 // Change to root scope
132 6533 currentScope = rootScope;
133
2/4
✓ Branch 35 → 36 taken 6533 times.
✗ Branch 35 → 38 not taken.
✓ Branch 36 → 37 taken 6533 times.
✗ Branch 36 → 38 not taken.
6533 assert(currentScope != nullptr && currentScope->type == ScopeType::GLOBAL);
134
135 // Do not type-check this manifestation again
136 6533 manifestation->alreadyTypeChecked = true;
137
138 6533 manIdx++; // Increase the manifestation index
139 }
140 15166 manIdx = 0; // Reset the manifestation index
141
142
1/2
✓ Branch 50 → 51 taken 15166 times.
✗ Branch 50 → 60 not taken.
30332 return nullptr;
143 }
144
145 2654 std::any TypeChecker::visitStructDefCheck(StructDefNode *node) {
146 2654 node->resizeToNumberOfManifestations(node->structManifestations.size());
147 2654 manIdx = 0; // Reset the manifestation index
148
149 // Get all manifestations for this procedure definition
150
2/2
✓ Branch 214 → 6 taken 4540 times.
✓ Branch 214 → 215 taken 2654 times.
9848 for (const Struct *manifestation : node->structManifestations) {
151 // Skip non-substantiated or already checked procedures
152
3/4
✓ Branch 8 → 9 taken 4540 times.
✗ Branch 8 → 298 not taken.
✓ Branch 9 → 10 taken 1134 times.
✓ Branch 9 → 11 taken 3406 times.
4540 if (!manifestation->isFullySubstantiated()) {
153 1134 manIdx++; // Increase the manifestation index
154 1134 continue;
155 }
156
157 // Change to struct scope
158
1/2
✓ Branch 11 → 12 taken 3406 times.
✗ Branch 11 → 298 not taken.
3406 changeToScope(manifestation->scope, ScopeType::STRUCT);
159
160 // Mount type mapping for this manifestation, so that the body preamble helpers below can substantiate
161 // generic field types (e.g. `heap T*` on `Vector<T>`). Without this, an auto-generated body preamble that
162 // touches a still-generic field would assert in TypeMatcher::substantiateTypeWithTypeMapping.
163
1/2
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 3406 times.
3406 assert(typeMapping.empty());
164
1/2
✓ Branch 15 → 16 taken 3406 times.
✗ Branch 15 → 298 not taken.
3406 typeMapping = manifestation->typeMapping;
165
166 // Re-visit all default values. This is required, since the type of the default value might vary for different manifestations
167
2/2
✓ Branch 39 → 18 taken 7302 times.
✓ Branch 39 → 40 taken 3406 times.
14114 for (const FieldNode *field : node->fields) {
168
2/2
✓ Branch 20 → 21 taken 1474 times.
✓ Branch 20 → 30 taken 5828 times.
7302 if (field->defaultValue != nullptr) {
169
1/2
✓ Branch 21 → 22 taken 1474 times.
✗ Branch 21 → 219 not taken.
1474 visit(field->defaultValue);
170
1/2
✓ Branch 23 → 24 taken 1474 times.
✗ Branch 23 → 221 not taken.
1474 SymbolTableEntry *fieldEntry = manifestation->scope->lookupStrict(field->fieldName);
171
1/2
✗ Branch 26 → 27 not taken.
✓ Branch 26 → 28 taken 1474 times.
1474 assert(fieldEntry != nullptr);
172
1/2
✓ Branch 28 → 29 taken 1474 times.
✗ Branch 28 → 220 not taken.
1474 fieldEntry->updateState(INITIALIZED, field);
173 }
174 }
175
176 // Build struct type
177
1/2
✓ Branch 40 → 41 taken 3406 times.
✗ Branch 40 → 298 not taken.
3406 const QualType structType = manifestation->entry->getQualType();
178
179 // Check if the struct implements all methods of all attached interfaces
180 3406 size_t vtableIndex = 0;
181
2/2
✓ Branch 145 → 43 taken 1002 times.
✓ Branch 145 → 146 taken 3406 times.
7814 for (const QualType &interfaceType : manifestation->interfaceTypes) {
182
1/2
✓ Branch 45 → 46 taken 1002 times.
✗ Branch 45 → 265 not taken.
1002 const Interface *interface = interfaceType.getInterface(node);
183
1/2
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 1002 times.
1002 assert(interface != nullptr);
184
185 // Check for all methods, that it is implemented by the struct
186
2/2
✓ Branch 135 → 50 taken 2502 times.
✓ Branch 135 → 136 taken 1002 times.
4506 for (const Function *expMethod : interface->methods) {
187
1/2
✓ Branch 52 → 53 taken 2502 times.
✗ Branch 52 → 263 not taken.
2502 const std::string methodName = expMethod->name;
188
1/2
✓ Branch 53 → 54 taken 2502 times.
✗ Branch 53 → 261 not taken.
2502 QualTypeList params = expMethod->getParamTypes();
189 2502 QualType returnType = expMethod->returnType;
190
191 // Substantiate param and return types
192
1/2
✓ Branch 54 → 55 taken 2502 times.
✗ Branch 54 → 259 not taken.
2502 TypeMatcher::substantiateTypesWithTypeMapping(params, interface->typeMapping, node);
193
3/4
✓ Branch 55 → 56 taken 2502 times.
✗ Branch 55 → 259 not taken.
✓ Branch 56 → 57 taken 1458 times.
✓ Branch 56 → 58 taken 1044 times.
2502 if (returnType.hasAnyGenericParts())
194
1/2
✓ Branch 57 → 58 taken 1458 times.
✗ Branch 57 → 259 not taken.
1458 TypeMatcher::substantiateTypeWithTypeMapping(returnType, interface->typeMapping, node);
195
196 // Build args list
197 2502 ArgList args;
198
1/2
✓ Branch 59 → 60 taken 2502 times.
✗ Branch 59 → 257 not taken.
2502 args.reserve(params.size());
199
2/2
✓ Branch 74 → 62 taken 22 times.
✓ Branch 74 → 75 taken 2502 times.
5026 for (const QualType &param : params)
200
1/2
✓ Branch 64 → 65 taken 22 times.
✗ Branch 64 → 222 not taken.
22 args.emplace_back(param, nullptr);
201
202 // Search for method that has the required signature
203
1/2
✓ Branch 76 → 77 taken 2502 times.
✗ Branch 76 → 224 not taken.
2502 Function *spiceFunction = FunctionManager::match(currentScope, methodName, structType, args, {}, true, node);
204
2/2
✓ Branch 78 → 79 taken 4 times.
✓ Branch 78 → 91 taken 2498 times.
2502 if (spiceFunction == nullptr) {
205
1/2
✓ Branch 84 → 85 taken 4 times.
✗ Branch 84 → 227 not taken.
4 softError(node, INTERFACE_METHOD_NOT_IMPLEMENTED,
206
5/10
✓ Branch 79 → 80 taken 4 times.
✗ Branch 79 → 239 not taken.
✓ Branch 80 → 81 taken 4 times.
✗ Branch 80 → 235 not taken.
✓ Branch 81 → 82 taken 4 times.
✗ Branch 81 → 233 not taken.
✓ Branch 82 → 83 taken 4 times.
✗ Branch 82 → 231 not taken.
✓ Branch 83 → 84 taken 4 times.
✗ Branch 83 → 229 not taken.
8 "The struct '" + node->structName + "' does not implement method '" + expMethod->getSignature() + "'.");
207 4 continue;
208 }
209
210 // Check return type
211
5/6
✓ Branch 91 → 92 taken 2498 times.
✗ Branch 91 → 257 not taken.
✓ Branch 92 → 93 taken 468 times.
✓ Branch 92 → 96 taken 2030 times.
✓ Branch 97 → 98 taken 2 times.
✓ Branch 97 → 110 taken 2496 times.
2966 if (spiceFunction->returnType != returnType &&
212
3/4
✓ Branch 93 → 94 taken 468 times.
✗ Branch 93 → 257 not taken.
✓ Branch 94 → 95 taken 2 times.
✓ Branch 94 → 96 taken 466 times.
468 !returnType.matchesInterfaceImplementedByStruct(spiceFunction->returnType)) {
213
1/2
✓ Branch 103 → 104 taken 2 times.
✗ Branch 103 → 242 not taken.
2 softError(node, INTERFACE_METHOD_NOT_IMPLEMENTED,
214
4/8
✓ Branch 98 → 99 taken 2 times.
✗ Branch 98 → 254 not taken.
✓ Branch 99 → 100 taken 2 times.
✗ Branch 99 → 250 not taken.
✓ Branch 100 → 101 taken 2 times.
✗ Branch 100 → 248 not taken.
✓ Branch 101 → 102 taken 2 times.
✗ Branch 101 → 246 not taken.
4 "The struct '" + node->structName + "' does not implement method '" + expMethod->getSignature() +
215
1/2
✓ Branch 102 → 103 taken 2 times.
✗ Branch 102 → 244 not taken.
2 "'. The return type does not match.");
216 2 continue;
217 }
218 // Set to virtual, since it overrides the interface method
219 2496 spiceFunction->isVirtual = true;
220 2496 spiceFunction->vtableIndex = vtableIndex++;
221
6/6
✓ Branch 112 → 113 taken 2496 times.
✓ Branch 112 → 114 taken 6 times.
✓ Branch 117 → 118 taken 2496 times.
✓ Branch 117 → 119 taken 6 times.
✓ Branch 122 → 123 taken 2496 times.
✓ Branch 122 → 125 taken 6 times.
7506 }
222 }
223
224 // Check default ctor body if required
225
2/4
✓ Branch 149 → 150 taken 3406 times.
✗ Branch 149 → 268 not taken.
✓ Branch 150 → 151 taken 3406 times.
✗ Branch 150 → 266 not taken.
10218 const Function *ctorFunc = FunctionManager::lookup(currentScope, CTOR_FUNCTION_NAME, structType, {}, true);
226
4/4
✓ Branch 154 → 155 taken 1078 times.
✓ Branch 154 → 160 taken 2328 times.
✓ Branch 155 → 156 taken 174 times.
✓ Branch 155 → 160 taken 904 times.
3406 if (ctorFunc != nullptr && ctorFunc->implicitDefault) {
227
1/2
✓ Branch 156 → 157 taken 174 times.
✗ Branch 156 → 298 not taken.
174 createCtorBodyPreamble(ctorFunc->bodyScope);
228
2/4
✓ Branch 157 → 158 taken 174 times.
✗ Branch 157 → 298 not taken.
✗ Branch 158 → 159 not taken.
✓ Branch 158 → 160 taken 174 times.
174 assert(manifestation->areAllFieldsInitialized() == nullptr);
229 }
230
231 // Check default copy ctor body if required
232
2/4
✓ Branch 160 → 161 taken 3406 times.
✗ Branch 160 → 279 not taken.
✓ Branch 164 → 165 taken 3406 times.
✗ Branch 164 → 275 not taken.
10218 const ArgList args = {{structType.toConstRef(node), false /* always non-temporary */}};
233
2/4
✓ Branch 168 → 169 taken 3406 times.
✗ Branch 168 → 283 not taken.
✓ Branch 169 → 170 taken 3406 times.
✗ Branch 169 → 281 not taken.
3406 const Function *copyCtorFunc = FunctionManager::lookup(currentScope, CTOR_FUNCTION_NAME, structType, args, true);
234
4/4
✓ Branch 172 → 173 taken 763 times.
✓ Branch 172 → 178 taken 2643 times.
✓ Branch 173 → 174 taken 246 times.
✓ Branch 173 → 178 taken 517 times.
3406 if (copyCtorFunc != nullptr && copyCtorFunc->implicitDefault) {
235
1/2
✓ Branch 174 → 175 taken 246 times.
✗ Branch 174 → 296 not taken.
246 createCopyCtorBodyPreamble(copyCtorFunc->bodyScope);
236
2/4
✓ Branch 175 → 176 taken 246 times.
✗ Branch 175 → 296 not taken.
✗ Branch 176 → 177 not taken.
✓ Branch 176 → 178 taken 246 times.
246 assert(manifestation->areAllFieldsInitialized() == nullptr);
237 }
238
239 // Check default move ctor body if required. findMoveCtor scans the manifestations directly to avoid the
240 // constify-based false-positive that FunctionManager::lookup with a non-const ref arg can produce.
241
5/6
✓ Branch 178 → 179 taken 3406 times.
✗ Branch 178 → 296 not taken.
✓ Branch 179 → 180 taken 22 times.
✓ Branch 179 → 185 taken 3384 times.
✓ Branch 180 → 181 taken 17 times.
✓ Branch 180 → 185 taken 5 times.
3406 if (const Function *moveCtorFunc = FunctionManager::findMoveCtor(currentScope); moveCtorFunc && moveCtorFunc->implicitDefault) {
242
1/2
✓ Branch 181 → 182 taken 17 times.
✗ Branch 181 → 296 not taken.
17 createMoveCtorBodyPreamble(moveCtorFunc->bodyScope);
243
2/4
✓ Branch 182 → 183 taken 17 times.
✗ Branch 182 → 296 not taken.
✗ Branch 183 → 184 not taken.
✓ Branch 183 → 185 taken 17 times.
17 assert(manifestation->areAllFieldsInitialized() == nullptr);
244 }
245
246 // Check default dtor body if required
247
2/4
✓ Branch 188 → 189 taken 3406 times.
✗ Branch 188 → 289 not taken.
✓ Branch 189 → 190 taken 3406 times.
✗ Branch 189 → 287 not taken.
10218 const Function *dtorFunc = FunctionManager::lookup(currentScope, DTOR_FUNCTION_NAME, structType, {}, true);
248
4/4
✓ Branch 193 → 194 taken 1670 times.
✓ Branch 193 → 196 taken 1736 times.
✓ Branch 194 → 195 taken 1248 times.
✓ Branch 194 → 196 taken 422 times.
3406 if (dtorFunc != nullptr && dtorFunc->implicitDefault)
249
1/2
✓ Branch 195 → 196 taken 1248 times.
✗ Branch 195 → 296 not taken.
1248 createDtorBodyPreamble(dtorFunc->bodyScope);
250
251 // Reset field symbols to declared state for the next manifestation
252
1/2
✓ Branch 196 → 197 taken 3406 times.
✗ Branch 196 → 296 not taken.
3406 manifestation->resetFieldSymbolsToDeclared(node);
253
254 // Clear type mapping
255 3406 typeMapping.clear();
256
257 // Return to the root scope
258 3406 currentScope = rootScope;
259
2/4
✓ Branch 198 → 199 taken 3406 times.
✗ Branch 198 → 201 not taken.
✓ Branch 199 → 200 taken 3406 times.
✗ Branch 199 → 201 not taken.
3406 assert(currentScope != nullptr && currentScope->type == ScopeType::GLOBAL);
260
261 3406 manIdx++; // Increase the manifestation index
262 3406 }
263 2654 manIdx = 0; // Reset the manifestation index
264
265
1/2
✓ Branch 215 → 216 taken 2654 times.
✗ Branch 215 → 300 not taken.
5308 return nullptr;
266 }
267
268 } // namespace spice::compiler
269