[Issue 20308] New: frame access regression
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 20 20:56:51 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20308
Issue ID: 20308
Summary: frame access regression
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: john.loughran.colvin at gmail.com
template OverloadSet(Args ...)
{
static foreach (Arg; Args)
alias overloads = Arg;
}
struct S(handlers ...)
{
static struct HandlerGroup
{
static opCall(int a)
{
return OverloadSet!(handlers).overloads(a);
}
}
static auto ref call(alias f)()
{
return f(HandlerGroup.init);
}
}
void main()
{
assert(
S!((double z) => z, y => y)
.call!(r => r(1))()
== 1);
}
onlineapp.d(13): Error: static function onlineapp.main.S!(function (double z)
=> z, (y) => y).S.HandlerGroup.opCall cannot access frame of function D main
onlineapp.d(26): Error: template instance `onlineapp.main.S!(function (double
z) => z, (y) => y)` error instantiating
The regression was introduced by https://github.com/dlang/dmd/pull/10214 and
was released in 2.087.1
--
More information about the Digitalmars-d-bugs
mailing list