openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
753 stars 365 forks source link

Sensor.hx:15: unknown <0> cannot be constructed #1687

Open lazyremixmanordummyplayinggmod opened 1 year ago

lazyremixmanordummyplayinggmod commented 1 year ago

C:/HaxeToolkit/haxe/lib/lime/8,0,1/src/lime/system/Sensor.hx:15: characters 24-62 : Unknown<0> cannot be constructed

i'm trying to test but this error popped up i can't find any info on how to fix this i did not mess with anything in the lib folder

player-03 commented 1 year ago

Is there any chance you're importing Sensor during a macro? Or importing a class that imports it?

lazyremixmanordummyplayinggmod commented 1 year ago

maybe

lazyremixmanordummyplayinggmod commented 1 year ago

I checked i seen nothing

player-03 commented 1 year ago

Try adding conditional compilation.

    public var id:Int;
+   #if !macro
    public var onUpdate = new Event<Float->Float->Float->Void>();
+   #end
    public var type:SensorType;
lazyremixmanordummyplayinggmod commented 1 year ago

in the ones i have #if !macro in

joshtynjala commented 1 year ago

I got this error the other day when there was an issue with something completely unrelated to Sensor.

Commit d299add52df39e9e879bbf09c3eacde851eb2dba might have been what fixed it, but i don't remember for sure.

player-03 commented 1 year ago

Worth a shot. @ lazyremix, here are the steps to install from Git:

  1. Run haxelib git lime https://github.com/openfl/lime.git
  2. Navigate to C:/HaxeToolkit/haxe/lib/lime, and open both the 8,0,1/ folder and the git/ folder side-by-side.
  3. Copy the ndlls from 8,0,1/ndll/ into git/ndll/.
  4. Double-check that haxelib path lime points to the Git version.