Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator error with haxe 4.0.0-preview.5 #4

Open
tong opened this issue Dec 11, 2018 · 20 comments
Open

Generator error with haxe 4.0.0-preview.5 #4

tong opened this issue Dec 11, 2018 · 20 comments

Comments

@tong
Copy link
Contributor

tong commented Dec 11, 2018

hxArduino/src/ast2obj/Generator.hx:150: characters 58-67 : Null<haxe.macro.TypedExpr> should be Null<haxe.macro.TConstant>
hxArduino/src/ast2obj/Generator.hx:150: characters 58-67 : For function argument 'c'

Works with haxe 4.0.0-preview.4

@ianharrigan
Copy link
Owner

Ok, i feel like there are some issues with p5 currently, so hopefully this will be cleared up. I was running p5 and had to downgrade to p4 for a few reasons.

@ratkingsminion
Copy link

Still happening with haxe 4.0.0 rc3

@datee
Copy link

datee commented Jan 27, 2020

And with Haxe 4.0.5 - Any fix for this @ianharrigan ? :)

@ianharrigan
Copy link
Owner

ianharrigan commented Jan 27, 2020

OK, this should be fixed now, thanks for the reminder, id totally forgot about it!

EDIT: ive released haxelib v1.2.0 also....

@datee
Copy link

datee commented Jan 28, 2020

Ok, thanks! :) But ..trying to compile with Haxe 4.0.5 - creating a new class gives an error :

var myClass = new MyClass();
ast2obj/Generator.hx:150: characters 33-42 : Uncaught exception field access on null

This worked fine with the last version on 4.0.0.p4

@ianharrigan
Copy link
Owner

ianharrigan commented Jan 28, 2020

right... can you paste the entire source / project?

(including myClass, hxmls, etc)

@datee
Copy link

datee commented Jan 28, 2020

Its just the blink-01 example with added a new empty class with an empty function in it.
Tested it more and the error seems to be related to having parameters with a function:

OK : public function setSomeValue() { }
Creates exception : public function setSomeValue(value:Int) { }

@ianharrigan
Copy link
Owner

Whoops, yeah... dunno how i didnt catch that... i guess in my dumb tests when i was fixing for haxe4 i only tested with function param defaults (eg: value = 100).. doh

Should be fixed in latest haxelib

@datee
Copy link

datee commented Jan 28, 2020

Great! Now it compiles without error! :)

@datee
Copy link

datee commented Jan 28, 2020

But trying to run it gives another problem:
cmd: haxelib run hxArduino --test
Called from hxSerial/Serial.hx line 93
Uncaught exception - load.c(237) : Failed to load library : ./hxSerial.ndll

Where should the ndll be? putting it in the same project or path doesnt help.

@ianharrigan
Copy link
Owner

im not 100% sure of the internals of hxSerial tbh... not even sure if its haxe4 ready

I dont have an adruino setup to test here myself either...

@datee
Copy link

datee commented Jan 28, 2020

It worked with Haxe 4.0.0.p4 in the previous version when the ndll was in the same folder i think.
But havent been able to run it after the update

@ianharrigan
Copy link
Owner

ianharrigan commented Jan 28, 2020

i guess, thinking about it, i dont need to have a device to try and connect to it... let me have a go

Yeah, i get the same :/

@datee
Copy link

datee commented Jan 28, 2020

ok - so it seems to use it we have to revert back to the previous version with haxe 4.0.0p4 then for now...?

@ianharrigan
Copy link
Owner

ianharrigan commented Jan 28, 2020

well, hxSerial is just used to send it to the device. the output is in build/hxArduino/out... pretty sure there are other ways to get it to the device

@ianharrigan
Copy link
Owner

@ianharrigan
Copy link
Owner

if i cant get hxSerial to work, and once i have a device up and running, ill probably remove hxSerial and use one of these methods - feels better / safer...

@ianharrigan
Copy link
Owner

actually, looking at the source of the run command it isnt for sending it to the device, its to monitor the serial port for debug traces... so maybe this can be removed? Would defo be a shame though as thats useful

@ianharrigan
Copy link
Owner

Heres the "best" solution ive found so far:

the issue is that neko is 64bit and the hxSerial.dll is 32, ive built a new 64bit hxSerial.ndll, but cant get neko to pick up the correct one (it always seem to be looking in the Windows folder rather than the Windows64 folder), so my advice for now, is drop the attached hxSerial.ndll next to the run.n from this lib, then it should work, ill looking for a better, less manual solution, but at leas this means you can use the run command

hxSerial.zip

@datee
Copy link

datee commented Jan 29, 2020

Nice, it works perfect - even if its a bit manual!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants