Skip to content

Commit deb79f8

Browse files
committed
Fixes a segmentation fault for unnamed declarations.
An example is: ``` func: (t: int, f) = { f(t + 2); } main: () = { x: int = 4; // :(v) = ... causes the error. func(x, :(v) = std::cout << "Value: " << v << std::endl); } ```
1 parent b88b194 commit deb79f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/diagnostics.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace cpp2 {
8484
std::string result = {};
8585
auto parent = decl->get_parent();
8686

87-
while(parent != nullptr) {
87+
while(parent != nullptr && parent->identifier != nullptr) {
8888
result = parent->identifier->to_string() + dot(result) + result;
8989
parent = parent->get_parent();
9090
}

0 commit comments

Comments
 (0)