sandstone icon indicating copy to clipboard operation
sandstone copied to clipboard

Incorrect `Advancement` generic type inference

Open GrantGryczan opened this issue 3 years ago • 0 comments

Example:

Advancement('test', {
    criteria: {
        a: {
            trigger: 'minecraft:tick'
        },
        b: {
            trigger: 'minecraft:tick'
        }
    },
    requirements: ['a']
});

This should be inferred as Advancement<'a' | 'b'>, not Advancement<'a'>. Otherwise it thinks b is not a valid criterion.

image

Worst case, this should be fixed by removing this type parameter and accepting any string[] in requirements.

GrantGryczan avatar Jan 02 '22 10:01 GrantGryczan