Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
5.08k stars 707 forks source link

[Unity] Bug: $Ref<T>类型中多了value字段声明 #1752

Closed zxt5105515 closed 5 months ago

zxt5105515 commented 5 months ago

前置阅读 | Pre-reading

Puer的版本 | Puer Version

2.0.4

Unity的版本 | Unity Version

2021.3.21f1

发生在哪个平台 | Platform

Editor(mac)

错误信息 | Error Message

Editor/Resources/puerts/templates/dts.tpl.mjs 中定义了puerts.$ref返回值类型,但有个错误的value,导致下面的ts可以编译但有运行时错误

let a = puerts.$ref(1)
console.log(a.value)

dts.tpl.mjs中的定义

interface $Ref<T> {
    value: T
}

问题重现 | Bug reproduce

见上