Closed ncannasse closed 9 years ago
Can you show me how your User class looks like?
I think that should fix it. Can you check?
Hmmm travis is failing now. Wait a sec before you try
Does not the related field (uid from User) needs to be an ID field to ensure the relationship to be valid? if its only DInt, we're not sure it uniq, but its mandatory for the relation, or i miss something?
Le 02/02/2015 11:22, Nicolas Cannasse a écrit :
After updating, I can no longer compile my SPOD classes (long time not touched this)
|class Key extends sys.db.Object {
public var id : SId; public var encKey : haxe.io.Bytes; @:relation(uid) public var user : SNull<User>;
} |
It complains about |Unexpected id type (DInt), use either SId, SUid, SBigID or SString| I'm not sure why ? |uid| should be DInt there, SId being the primary key.
Also, we should not use |throw| here but |error()| and report the correct position the error occurs in user code.
Seems like @sebpatu https://github.com/sebpatu #2970 https://github.com/HaxeFoundation/haxe/pull/2970 is the cause, @waneck https://github.com/waneck since you merged it you take responsibility : I'm awaiting for your cut finger :)
— Reply to this email directly or view it on GitHub https://github.com/HaxeFoundation/haxe/issues/3828.
It should be fixed now, @ncannasse
@Simn @waneck
teste with 3.2rc1 Hi !
We have heap load of spod classes broken here.
we have something like that :
package db;
@:skip
class BaseUser extends sys.db.Object {
public var id : SInt; //changing to SId allows compilation...
...
@:relation(ruid)
public var refUser : SNull<User>;
}
package db;
class User extends baseUser{
}
error prints :
../twinBase/base/db/BaseUser.hx:25: characters 8-34 : Unexpected id type $t for the relation. Use either SId, SInt, SUId, SUInt, SBigID, SBigInt or SString
If i change SInt to SId , it works...I belive this use case should still be valid.
Thanks !
Yeah the code and error message don't really match up there.
@waneck: You'll have to address this before I can make a release.
I'll tackle this today. Sorry for taking so long!
@delahee , while the error message seems to be bad, you really haven't defined any id for the BaseUser
class. I don't even know how this used to work before!
Hmm okay, it seems that SPOD automatically considered the id
variable as the ID. I'll handle this then.
After updating, I can no longer compile my SPOD classes (long time not touched this)
It complains about
Unexpected id type (DInt), use either SId, SUid, SBigID or SString
I'm not sure why ?uid
should be DInt there, SId being the primary key.Also, we should not use
throw
here buterror()
and report the correct position the error occurs in user code.Seems like @sebpatu #2970 is the cause, @waneck since you merged it you take responsibility : I'm awaiting for your cut finger :)