Closed issuesbot closed 9 years ago
[comment from simon.kr...@simn.de, published at 06/10/2012, 13:26:53]
[comment from simon.kr...@simn.de, published at 06/10/2012, 13:27:32]
[comment from si...@haxe.org, published at 09/02/2013, 19:09:24] Please post complete examples which can be compiled without building much infrastructure around it manually.
[comment from ncanna...@gmail.com, published at 21/02/2013, 08:04:45]
[comment from si...@haxe.org, published at 24/02/2013, 17:12:14]
[comment from francois...@gmail.com, published at 22/03/2013, 11:08:30] Hi , here is a standalone version of the code. ( tested on haxe 2.11 ) It still throws a "Unknown constructor mode" at compile time.
package ; import sys.db.Types;
class Main
{ static function main() { var main = new Main(); } function new() { var cnx = sys.db.Mysql.connect({ host : "localhost", port : null, user : "root", pass : "", database : "test", socket : null, }); sys.db.Manager.cnx = cnx; if ( !sys.db.TableCreate.exists(Party.manager) ){ sys.db.TableCreate.create(Party.manager); } var mode:GameMode = GM_LEAGUE; var p = Party.manager.search( $mode==mode, false ); } }
class Party extends sys.db.Object{ public var id : SId; public var gameId : SInt; public var userId : SInt; public var mode : SEnum; }
enum GameMode { GM_PROGRESSION; GM_LEAGUE; GM_MISSION; GM_CLAN; }
Hi I'm still having this bug in a new project ... one year passed since this issue submission , don't forget SPOD guys ;) ...
Hi, Maybe i missed something, but the bug is still present in the latest git build. We can't use variable when searching on a SEnum<> spod field. The following code doesn't compile :
package ; import sys.db.Types;
class Main { static function main() { var main = new Main(); } function new() { var t : EnumTest = EnumTest.second; TestSPOD.manager.search($test == first); TestSPOD.manager.search($test == EnumTest.first); // Error : Should be a constant constructor TestSPOD.manager.search($test == t); // Error : Unknown constructor t TestSPOD.manager.search($test == (cast t)); // Error : Should be a constant constructor } } class TestSPOD extends sys.db.Object{ public var id : SId; public var test : SEnum< EnumTest >; } enum EnumTest { first; second; }
You're right! Sorry about this
[Google Issue #1199 : https://code.google.com/p/haxe/issues/detail?id=1199] by francois...@gmail.com, at 28/09/2012, 14:22:48
class Party extends sys.db.Object
var mode:GameMode = ....;
return db.Party.manager.search( $userId == App.current.user.id && $gameId == gameId && $endTime!=null && $mode==mode, { orderBy:-id, limit:limit },lock );
throws a "Unknown constructor mode" at compile time.
It doesnt happen if I use one of the Enum value directly instead of a variable. ( like GM_LEAGUE instead of 'mode' )