Closed pelikhan closed 3 years ago
It seems that generics break the fixedInstance resolution chain. We are using a generic SensorClient class in pxt-jacdac and loosing the base "connection" event. So either we need to fix PXT or change pxt-jacdac.
repro: https://makecode.microbit.org/_fAA0oz9LaAPy
// Fixed instance do not support generics namespace bug { //% fixedInstances class Base { constructor() { } //% block="%base foo" foo() { } } //% fixedInstance whenUsed const base = new Base() class Child extends Base { constructor() { super() } } //% fixedInstance whenUsed const child = new Child() class ChildT<T> extends Base { constructor() { super() } } //% fixedInstance whenUsed const childT = new ChildT<number>() class GrandChildT extends ChildT<number> { constructor() { super() } } //% fixedInstance whenUsed const grandChild = new GrandChildT() }
Removed generics.
It seems that generics break the fixedInstance resolution chain. We are using a generic SensorClient class in pxt-jacdac and loosing the base "connection" event. So either we need to fix PXT or change pxt-jacdac.
repro: https://makecode.microbit.org/_fAA0oz9LaAPy