chore: 发布准备——修复 cjlint MANDATORY 错误 + 补 org 配置
publish 流程会执行 cjlint(error 即阻塞),修复: - 测试枚举 Role.User 与类型名 User 冲突 → 改名 Role.Member(G.ENU.01) - 测试用例函数补 : Unit 返回类型(G.DCL.02) - JsonOption.instance 补显式类型(G.DCL.02) - JsonReader.readParentFields 移除未使用 options 参数(G.FUN.02) - Annotations.cj 移除硬编码 URL(G.OTH.03) - 宏 FieldVisitor.visit 补 : Unit(G.DCL.02) - cjpm.toml 增加 org = "simcu"(publish 自动写入) cjpm bundle 已可成功生成 simapi_serialization-1.0.0.cjp, 剩余阻塞:中心仓认证(pkg.cangjie-lang.cn 需用户 token)
This commit is contained in:
@@ -23,5 +23,5 @@ public class JsonOption {
|
||||
public init() {}
|
||||
|
||||
/// 默认选项实例
|
||||
public static let instance = JsonOption()
|
||||
public static let instance: JsonOption = JsonOption()
|
||||
}
|
||||
|
||||
@@ -137,14 +137,14 @@ public class JsonReader {
|
||||
}
|
||||
}
|
||||
// 父类字段(@SerializerParent 宏生成的静态导入方法,沿继承链逐层回填)
|
||||
readParentFields(value, ct, instance, options)
|
||||
readParentFields(value, ct, instance)
|
||||
instance
|
||||
}
|
||||
|
||||
/// 沿 superClass 链调用每层的 importJsonFields 静态方法回填父类字段。
|
||||
/// 无宏的父类(hasImportFields 缓存判断)静默跳过;宏生成的方法内部按
|
||||
/// if (k == "字段名") 忽略未知键,因此直接把全部 JSON 键传入即可。
|
||||
private static func readParentFields(value: JsonValue, ct: ClassTypeInfo, instance: Any, options: JsonOption): Unit {
|
||||
private static func readParentFields(value: JsonValue, ct: ClassTypeInfo, instance: Any): Unit {
|
||||
let jobj = value.asObject()
|
||||
var parent = ct.superClass
|
||||
while (let Some(p) <- parent) {
|
||||
|
||||
Reference in New Issue
Block a user