Skip to content

[Bug]: Typekits create unfinished types #9560

@witemple-msft

Description

@witemple-msft

Describe the bug

Some typekits (at least model.create and modelProperty.create from my testing) return unfinished types.

Very bad and difficult to debug things can happen if you forget to finish the Type yourself with program.finishType: unfinished types can be passed back into the checker resulting in decorators not running, etc. because the checker believes the types aren't done, but they will never be done unless you manually call finishType.

This has bitten me several times. TKs should always return fully checked (finished) instances.

Reproduction

$(program).modelProperty.create({
  name: "foo",
  type: $(program).builtin.string
}).isFinished;
// false

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions