HaxeFoundation / HaxeFoundation/record-macros
haxe.macro.Compiler.setFieldType
- Dominant language
- Haxe
- Stars
- 48
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Hej !
Happy Christmas everyone !
I'm sorry, I always come with strange things...
Last changes in __RecordMacros.hx__ related to :
```haxe
var get = {
args : [],
params : [],
ret : t,
expr: macro return @:privateAccess $i{tname}.manager.__get(this, $v{f.name}, $v{relKey}, $v{lock}),
//expr : Context.parse("return untyped "+tname+".manager.__get(this,'"+f.name+"','"+relKey+"',"+lock+")",pos),
};
```
https://github.com/HaxeFoundation/record-macros/blob/aaa5f70d233e1aedd0ef2e53f821469125f57c06/src/sys/db/RecordMacros.hx#L1380
Makes Haxe complain when trying to build my code.
I've done a small example, let's say we have that :
__Main.hx__
```haxe
class Main{
static var foo : Foo;
public static function main(){}
}
```
__Foo.hx__
```haxe
class Foo extends sys.db.Object{
var id : sys.db.Types.SId;
@:relation( barID )
public var bar : Bar;
}
```
__Bar.hx__
```haxe
class Bar extends sys.db.Object{
var id : sys.db.Types.SId;
}
```
__my/Bar.hx__
```haxe
package my;
class Bar extends sys.db.Object{
var id : sys.db.Types.SId;
var b : Bool;
}
```
__build.hxml__
```haxe
-lib record-macros
#--macro haxe.macro.Compiler.setFieldType( "Foo", "bar", "my.Bar" )
-main Main
-php www
```
If this line is commented, all runs well, but when it's set, I get this error : `record-macros/git/src/sys/db/RecordMacros.hx:1391: characters 46-53 : Unknown identifier : my.Bar`
Is there something we could do to make it work again like before please ? (Before, `untyped` was used but now, with the strict synthax, the compiler complains...)
Thanks for reading,
Cheers,
Michal
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.