unyt-org / datex-core-js-legacy

DATEX Core Library for JavaScript (legacy), fully implemented in TypeScript, used by the UIX Framework
https://unyt.org
3 stars 0 forks source link

Type conflict when setting Pointer<boolean>.val #105

Open asbng opened 5 months ago

asbng commented 5 months ago

Reproducible Example

UIX - frontend/example.ts:

const booleanPointer = $$(false);
booleanPointer.val = true;

Versions

UIX: 0.2.5 DATEX: 0.1.4

Issue

Setting a boolean pointer's .val to a boolean value is expected to work without showing type warnings. While the code above works as intended, the Deno TypeScript linter will show the following type conflict for line 2:

Type 'boolean' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'. deno-ts(2322)

This does not happen for string and number pointers.

benStre commented 5 months ago

This was an issue with older Deno/TS versions and should no longer happen (see https://github.com/microsoft/TypeScript/issues/56320)

Can you confirm that this?