Code Monkey home page Code Monkey logo

Comments (2)

 avatar commented on July 21, 2024

I can confirm that it's your wrapper.d that does not support string that represent modules and packages.

The easy fix would be

@@ -76,12 +76,15 @@ string wrapModuleWorksheetFunctionsString(string moduleName)
     mixin(`import ` ~ moduleName ~ `;`);
     alias module_ = Identity!(mixin(moduleName));
 
     string ret;
 
-    foreach(moduleMemberStr; __traits(allMembers, module_))
-        ret ~= wrapModuleMember!(moduleName, moduleMemberStr)(onlyExports, pascalCase, callingModule);
+    static foreach (moduleMemberStr; __traits(allMembers, module_))
+    {
+        static if (!(is(mixin(moduleMemberStr) == module) || is(mixin(moduleMemberStr) == package)))
+            ret ~= wrapModuleMember!(moduleName, moduleMemberStr)(onlyExports, pascalCase, callingModule);
+    }
 
     return ret;
 }
 
 string wrapModuleMember(string moduleName, string moduleMemberStr)

but then new errors come which are unrelated...

$ dub test --compiler=$DC
Running custom 'unittest' configuration.
Performing "unittest" build using /home/nils/dev/repos/dlang/dmd/generated/linux/release/64/dmd for x86_64.
automem 0.6.2: target for configuration "library" is up to date.
localimport 1.3.0: target for configuration "unittest" is up to date.
nogc 0.5.0: target for configuration "library" is up to date.
unit-threaded:from 0.10.8: target for configuration "library" is up to date.
unit-threaded:exception 0.10.8: target for configuration "library" is up to date.
unit-threaded:assertions 0.10.8: target for configuration "library" is up to date.
unit-threaded:integration 0.10.8: target for configuration "library" is up to date.
unit-threaded:mocks 0.10.8: target for configuration "library" is up to date.
unit-threaded:property 0.10.8: target for configuration "default" is up to date.
unit-threaded:runner 0.10.8: target for configuration "library" is up to date.
unit-threaded 0.10.8: target for configuration "library" is up to date.
excel-d 0.5.7+commit.18.gbf99ffe: building configuration "unittest"...
source/xlld/wrap/traits.d(167,36): Error: circular reference to variable xlld.wrap.traits.isSupportedFunction!(FuncAddEverything, isWantedType).returnTypeOk
source/xlld/wrap/wrap.d(582,32): Error: template instance xlld.wrap.traits.isSupportedFunction!(FuncAddEverything, isWantedType) error instantiating
source/xlld/wrap/wrap.d(107,15): instantiated from here: isWorksheetFunction!(FuncAddEverything)
source/xlld/wrap/wrap.d(84,20): instantiated from here: wrapModuleMember!("test.d_funcs", "FuncAddEverything")
source/xlld/wrap/wrap.d(54,16): instantiated from here: wrapModuleWorksheetFunctionsString!"test.d_funcs"
source/xlld/wrap/wrap.d(31,9): instantiated from here: wrapWorksheetFunctionsString!"test.d_funcs"
tests/ut/wrap/wrapped.d(14,7): instantiated from here: wrapAll!"test.d_funcs"
source/xlld/wrap/traits.d(165,29): Error: template instance xlld.wrap.wrap.functionTypePredicate!double error instantiating
source/xlld/wrap/wrap.d(582,32): instantiated from here: isSupportedFunction!(FuncAddEverything, isWantedType)
source/xlld/wrap/wrap.d(107,15): instantiated from here: isWorksheetFunction!(FuncAddEverything)
source/xlld/wrap/wrap.d(84,20): instantiated from here: wrapModuleMember!("test.d_funcs", "FuncAddEverything")
source/xlld/wrap/wrap.d(54,16): ... (1 instantiations, -v to show) ...
source/xlld/wrap/wrap.d(31,9): instantiated from here: wrapWorksheetFunctionsString!"test.d_funcs"
tests/ut/wrap/wrapped.d(14,7): instantiated from here: wrapAll!"test.d_funcs"
source/xlld/wrap/wrap.d(131,13): Error: static assert: "excel-d ERROR: Function FuncAddEverything not eligible for wrapping"
source/xlld/wrap/wrap.d(84,20): instantiated from here: wrapModuleMember!("test.d_funcs", "FuncAddEverything")
source/xlld/wrap/wrap.d(54,16): instantiated from here: wrapModuleWorksheetFunctionsString!"test.d_funcs"
source/xlld/wrap/wrap.d(31,9): instantiated from here: wrapWorksheetFunctionsString!"test.d_funcs"
tests/ut/wrap/wrapped.d(14,7): instantiated from here: wrapAll!"test.d_funcs"

That'd be nice if you could take a look at that using DMD built from my DMD PR.

from excel-d.

 avatar commented on July 21, 2024

...in the next days so that would eventually permit to have already 2 important fixes for allMember + import in next DMD release (beta should come by a week I think).

from excel-d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.