jangko / nimPNG

PNG (Portable Network Graphics) decoder and encoder written in Nim
MIT License
90 stars 12 forks source link

make `getUnderlyingType` work with type argument #83

Closed metagn closed 1 year ago

metagn commented 1 year ago

Below newStorage[T] and newStorageOfCap[T] call getUnderlyingType(T), which shouldn't work because T is a type and getUnderlyingType takes an openArray argument. However it works due to a Nim bug where T is treated as a value of its type.

To make this work with and without the bug fixed, add an additional getUnderlyingType overload that takes a type openArray parameter instead.