February 16, 2022
https://issues.dlang.org/show_bug.cgi?id=20808

--- Comment #9 from Adam D. Ruppe <destructionator@gmail.com> ---
Oh, I think I linked to the wrong commit. Take that jsvar and modify line 681 to


fargs[idx] = args[idx].get!(typeof(a));



so removing the cast to Unqual. Now compile it:

---
import arsd.jsvar;

void printInt(const int value)
{
    assert(0);
}

void main(string [] args)
{
    var globals = var.emptyObject;
    globals.printInt = &printInt;
    //globals["printInt"] = &printInt;

    globals.printInt()(5);
}
---

No error. Run it, no assert.


Switch to the [] index version:

---
$ dmd a.d jsvar.d
jsvar.d(681): Error: cannot modify `const` expression `__fargs_field_0`
jsvar.d(1355): Error: template instance `arsd.jsvar.var.opAssign!(void
function(const(int)))` error instantiating
jsvar.d(1311):        instantiated from here: `opIndexAssign!(void
function(const(int)))`
a.d(12):        instantiated from here: `opIndexAssign!(void
function(const(int) value))`
jsvar.d(1319): Error: template instance `arsd.jsvar.var.__ctor!(void
function(const(int)))` error instantiating
a.d(12):        instantiated from here: `opIndexAssign!(void
function(const(int) value))`
---


So problem still there on 2.098.0

--
December 13
https://issues.dlang.org/show_bug.cgi?id=20808

--- Comment #10 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19701

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--
1 2
Next ›   Last »