[fix] 修复为cs_unity_json生成 反序列化external bean类型的编译错误bug
parent
ff6e09ec9d
commit
69a0acf63e
|
|
@ -1,6 +1,7 @@
|
||||||
using Luban.Job.Cfg.Datas;
|
using Luban.Job.Cfg.Datas;
|
||||||
using Luban.Job.Common.Types;
|
using Luban.Job.Common.Types;
|
||||||
using Luban.Job.Common.TypeVisitors;
|
using Luban.Job.Common.TypeVisitors;
|
||||||
|
using Luban.Job.Common.Utils;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Luban.Job.Cfg.TypeVisitors
|
namespace Luban.Job.Cfg.TypeVisitors
|
||||||
|
|
@ -80,7 +81,8 @@ namespace Luban.Job.Cfg.TypeVisitors
|
||||||
|
|
||||||
public string Accept(TBean type, string json, string x, int depth)
|
public string Accept(TBean type, string json, string x, int depth)
|
||||||
{
|
{
|
||||||
return $"{x} = {type.CsUnderingDefineType()}.Deserialize{type.Bean.Name}({json});";
|
string src = $"{type.Bean.FullName}.Deserialize{type.Bean.Name}({json});";
|
||||||
|
return $"{x} = {ExternalTypeUtil.CsCloneToExternal(type.Bean.FullName, src)};";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Accept(TArray type, string json, string x, int depth)
|
public string Accept(TArray type, string json, string x, int depth)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using Luban.Job.Cfg.Datas;
|
using Luban.Job.Cfg.Datas;
|
||||||
using Luban.Job.Common.Types;
|
using Luban.Job.Common.Types;
|
||||||
using Luban.Job.Common.TypeVisitors;
|
using Luban.Job.Common.TypeVisitors;
|
||||||
|
using Luban.Job.Common.Utils;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Luban.Job.Cfg.TypeVisitors
|
namespace Luban.Job.Cfg.TypeVisitors
|
||||||
|
|
@ -81,7 +82,8 @@ namespace Luban.Job.Cfg.TypeVisitors
|
||||||
|
|
||||||
public string Accept(TBean type, string json, string x, int depth)
|
public string Accept(TBean type, string json, string x, int depth)
|
||||||
{
|
{
|
||||||
return $"{{ if(!{json}.IsObject) {{ throw new SerializationException(); }} {x} = {type.CsUnderingDefineType()}.Deserialize{type.Bean.Name}({json}); }}";
|
string src = $"{type.Bean.FullName}.Deserialize{type.Bean.Name}({json})";
|
||||||
|
return $"{{ if(!{json}.IsObject) {{ throw new SerializationException(); }} {x} = {ExternalTypeUtil.CsCloneToExternal(type.Bean.FullName, src)}; }}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Accept(TArray type, string json, string x, int depth)
|
public string Accept(TArray type, string json, string x, int depth)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue