beefytech / Beef

Beef Programming Language
http://www.beeflang.org
Other
2.5k stars 130 forks source link

Crash and other issues while compiling project #1653

Closed disarray2077 closed 2 years ago

disarray2077 commented 2 years ago

My project is causing some issues in Beef, the first one is an error that I sometimes get when trying to compile the project:

ERROR: Unable to comptime PigoFramework.PropertyType<PigoFramework.Graphics.Component, "X">.GetPropertyType(System.String prop)
  while specializing type 'PigoFramework.PropertyType<PigoFramework.Graphics.Component, "X">' at line 8:38 in d:\BeefLang\TestGame\PigoFramework\src\Helpers\TypeTraits.bf
  public typealias Result = comptype(GetPropertyType(TProperty));
                                     ^^^^^^^^^^^^^^^
  > Fatal Error: No field or property named X. at line 19 in d:\BeefLang\TestGame\PigoFramework\src\Helpers\TypeTraits.bf in comptime System.Runtime.FatalError(System.String msg = "Fatal error encountered", System.String filePath = Compiler.CallerFilePath, int line = Compiler.CallerLineNum) at line 387:4 in d:\BeefLang\Repository\Beef\BeefLibs\corlib\src\Runtime.bf
  > in comptime PigoFramework.PropertyType<PigoFramework.Graphics.Component, "X">.GetPropertyType(System.String prop) at line 19:58 in d:\BeefLang\TestGame\PigoFramework\src\Helpers\TypeTraits.bf

The second one is a crash when I try to compile, this crash seems a bit random but cleaning Beef usually triggers it:

https://user-images.githubusercontent.com/86157825/180275811-a7b4ac3a-c156-4bb5-be89-a1a7dc0129a8.mp4

The third one is an error I get if and only if I try to run comptime debug:

ERROR: Fatal Error: No field or property named null. at line 19 in d:\BeefLang\TestGame\PigoFramework\src\Helpers\TypeTraits.bf

The fourth one is an error I get when trying to compile the project after running comptime debug:

PigoFramework__.lib(PigoFramework_GameBase.obj) : error LNK2019: unresolved external symbol "public: void __cdecl bf::PigoFramework::GameBase::Setup$wx(void)" (?Setup$wx@GameBase@PigoFramework@bf@@QEAAXXZ) referenced in function "public: struct bf::System::Result<void> __cdecl bf::PigoFramework::GameBase::Setup(struct bf::PigoFramework::GameOptions)" (?Setup@GameBase@PigoFramework@bf@@QEAA?AU?$Result@X@System@3@UGameOptions@23@@Z)

The project has been sent to Beef's email, the project's external dependencies are the following:

Tested with: https://github.com/beefytech/Beef/commit/119e9189e5cc41c747b2af01abbb87966cb6b422

bfiete commented 2 years ago

Crash fixed at 51713a1e34314644f26d9cce6f18ee0aa0d6ba3b Debugger break fixed at b1e1720f9ddcd8cf19429f324c107c0d3e7e4d2d

Are you able to still get the link error after these fixes? I wasn't able to reproduce it...

disarray2077 commented 2 years ago

@bfiete No, I guess it was happening because of the "No field or property named null." error in comptime debug, but that error was fixed. But looks like if you intentionally cause an error in comptime debug and then try to build the solution, the IDE crashes:

https://user-images.githubusercontent.com/86157825/181602136-c11e290b-de4a-4582-a839-bf3f1ef25a70.mp4

bfiete commented 2 years ago

Crash fixed at 1806cb923bb319ebc18559e1bffa87990525d6a4

Also comptime errors from alias failures are handled a bit better - they would only occur on the first compilation before, but now they should occur on every compilation.