<script setup lang="ts"> ts无法验证

<script setup lang="ts">

type test = { name: string; age: number }
let aa: test = {
  name: 'a',
  age: 12
}
aa.bbb = 'c'
console.log(aa)
</script>

<script lang="ts">里面 编译不通过,是正确的
<script setup lang="ts">里面,编译通过了,不应该