Skip to content

type: null 类型推断错误 #369

@yangmingshan

Description

@yangmingshan

#363 引入了一个类型推断的 Bug

Component({
  properties: {
    any: {
      type: null,
      value: '',
    },
  },
  methods: {
    test() {
      this.data.any // 应该是 any,但是推断成了 nerver
    },
  }
})

暂时的 Workaround

Component({
  properties: {
    any: {
      type: null,
      value: '' as any,
    },
  },
  methods: {
    test() {
      this.data.any // any
    },
  }
})

cc @LastLeaf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions