On Saturday, 18 April 2020 at 09:19:48 UTC, Simen Kjærås wrote:
On Wednesday, Friday, 17 Apr 2020 17:45:47 UTC, H. S. Teoh wrote:

I wonder if the ultimate cause of the above case is ultimately caused by the change to import semantics that hid private symbols from outside the module. Perhaps something, somewhere, is triggering an illegal access of a private symbol, which percolates up the call/instantiation stack and
causing what appears to be a strange compiler discrepancy.

Not unlikely. Importing the module defining S in the module defining ParameterDefaults does indeed make things compile. Hiding S by making it private makes the error return.

It's not about private. Or even if it is, there's other issues. Proof:

struct A {
    struct S {}
    void f(@S int = 3);
    pragma(msg, Issue20744!f);
}

template Issue20744(func...) {
    static if (is(typeof(func[0]) PT == __parameters)) {
        alias Issue20744 = (PT args) {};
    }
}

--
  Simen

Reply via email to