Coder Social home page Coder Social logo

gmlodash's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gmlodash's Issues

When including GMLodash; project fails to compile in YYC mode

Hello! I've discovered what might be an issue with GMLodash. I haven't been able to find a GM-specific bug for this issue (though I'll continue to find if one exists one).

To create a reproducible setup, I created a new blank project and added the following test object to the starting room:

Create event:

/// @description Set up struct for listening

users = [
    { user: "foo", age: 25, active: true },
    { user: "bar", age: 29, active: false },
    { user: "baz", age: 29, active: true }
];

Step event:

/// @description Listen for keyboard input and use GMLodash

if(keyboard_check_pressed(ord("1"))) {
	var returned = _.find(users, { active: false });
	show_debug_message(string(returned));
}

if(keyboard_check_pressed(ord("2"))) {
	var returned = _.find(users, { active: true });
	show_debug_message(string(returned));
}

All this does is listen to the keyboard inputs 1 and 2, and it would console out matches within the users array. This works find when I run the game in VM mode. But when I switch to YYC mode and try run it, it fails to build with the following error:

Error : gml_Object_testFindFunction_Step_0(0) : Fatal Error while compiling gml_Object_testFindFunction_Step_0 - bailing details below
Final Compile...System.InvalidOperationException: Stack empty.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Stack`1.Pop()
   at GMAssetCompiler.GML2CPP.�(GMLToken �, Boolean �, StringBuilder �, CPPVarRef �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMLToken �)
   at GMAssetCompiler.GML2CPP.�(GMAssets �, � �)
finished.

And some additional information: when I comment-out the use use _.find() and have nothing in the project using GMLodash - but with GMLodash still included as a separate script file - I get the following different set of errors:

Build for architecture - x86

Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_Object_testFindFunction_Step_0.gml.cpp:43:66: error: use of undeclared identifier 'kVARID_self_returned'
YYRValue* sself_returned = &((CInstanceBase*)pSelf)->GetYYVarRef(kVARID_self_returned); /* set ContextID to sself_returned */
                                                                 ^
1 error generated.
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4678:10: error: redefinition of 'local_args' with a different type: 'YYRValue' vs 'YYLocalArgs'
YYRValue local_args;
         ^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4666:13: note: previous definition is here
YYLocalArgs local_args( _count, 2, _args );
            ^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4762:11: error: no viable overloaded '='
local_args=YYGML_ds_stack_pop((int)(int64)((int)(int64)/* local */local_stack.asReal()));
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X://yyc/include\YYGML.h:2328:8: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'YYRValue' to 'const YYLocalArgs' for 1st argument
struct YYLocalArgs
       ^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4765:153: error: type 'YYLocalArgs' does not provide a subscript operator
local_value=/* array index changed from System.Collections.Generic.List`1[System.String] to System.Collections.Generic.List`1[System.String]*/local_args[(int)(0)];
                                                                                                                                              ~~~~~~~~~~^~~~~~~~~
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4769:37: error: type 'YYLocalArgs' does not provide a subscript operator
local_limit=/* volatile */local_args[(int)(1)];
                          ~~~~~~~~~~^~~~~~~~~
4 errors generated.

I'm running GM v2.3.0.529, Runtime v2.3.0.401; I'll continue to look for other causes of this, and I'll update this issue if/when I find any other info.

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.