PMunch / protobuf-nim

Protobuf implementation in pure Nim that leverages the power of the macro system to not depend on any external tools
MIT License
171 stars 14 forks source link

remain backwards compatible with earlier Nim versions #25

Closed narimiran closed 3 years ago

PMunch commented 3 years ago

This is what I meant when I said cruft. At least make a new type with a when statement, or something like when (NimMajor, NimMinor) < (1, 4): type AssertionDefect = AssertionException

You should also change this if you want it to be reverse compatible: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf.nim#L269

narimiran commented 3 years ago

This is what I meant when I said cruft. At least make a new type with a when statement, or something like when (NimMajor, NimMinor) < (1, 4): type AssertionDefect = AssertionException

Changed.

You should also change this if you want it to be reverse compatible: https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf.nim#L269

It seems there's no need for that: Defect is defined even in Nim 1.0.