[Issue 22516] New: Segfault for function literal in struct initializer with previous errors
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 17 08:48:59 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22516
Issue ID: 22516
Summary: Segfault for function literal in struct initializer
with previous errors
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: moonlightsentinel at disroot.org
The following code segfaults since 2.072:
struct Data
{
void function() eval;
}
struct Builtins
{
X x; // Unknown type X
Data myData = { (){} };
}
The problem here is that the error in `x` causes semantic3 for the function
literal to be skipped because of errors in the parent. Later code tries to
access the missing return type of the function literal.
--
More information about the Digitalmars-d-bugs
mailing list