How can I overwrite the object being extended with...
# announcements
c
How can I overwrite the object being extended with an extension property? E.g.:
Copy code
var UByte.upperNibble get() = (this.toInt() shr 4 and 0b1111).toUByte()
    set(value) {
        assert(value <= 0xFFu)
        this = (value.toUInt() shr 4) + this.lowerNibble // this line doesn't work; "variable expected"
    }