guzba / zippy

Pure Nim implementation of deflate, zlib, gzip and zip.
MIT License
246 stars 29 forks source link

compile error (targetting javascript) #14

Closed dullbananas closed 3 years ago

dullbananas commented 3 years ago

compilation command:

nimble js -o:public/main.js src/main.nim

nimble: v0.11.0

nim: v1.0.6

output:

/home/codespace/.nimble/pkgs/zippy-0.5.5/zippy/common.nim(137, 13) Error: type mismatch: got <int literal(16), uint8>
but expected one of: 
proc `-`(x: int8): int8
  first type mismatch at position: 2
  extra argument given
proc `-`(x: int16): int16
  first type mismatch at position: 2
  extra argument given
proc `-`(x, y: float32): float32
  first type mismatch at position: 2
  required type for y: float32
  but expression 'length' is of type: uint8
proc `-`(x: float32): float32
  first type mismatch at position: 2
  extra argument given
proc `-`(x, y: int32): int32
  first type mismatch at position: 2
  required type for y: int32
  but expression 'length' is of type: uint8
proc `-`(x: float): float
  first type mismatch at position: 2
  extra argument given
proc `-`(x: int32): int32
  first type mismatch at position: 2
  extra argument given
proc `-`(x, y: int8): int8
  first type mismatch at position: 2
  required type for y: int8
  but expression 'length' is of type: uint8
proc `-`[T: SomeUnsignedInt](x, y: T): T
  first type mismatch at position: 2
  required type for y: T: SomeUnsignedInt
  but expression 'length' is of type: uint8
proc `-`(x, y: int16): int16
  first type mismatch at position: 2
  required type for y: int16
  but expression 'length' is of type: uint8
proc `-`(x: int): int
  first type mismatch at position: 2
  extra argument given
proc `-`(x, y: float): float
  first type mismatch at position: 2
  required type for y: float
  but expression 'length' is of type: uint8
proc `-`(x: int64): int64
  first type mismatch at position: 2
  extra argument given
proc `-`(x, y: int64): int64
  first type mismatch at position: 2
  required type for y: int64
  but expression 'length' is of type: uint8
proc `-`(x, y: int): int
  first type mismatch at position: 2
  required type for y: int
  but expression 'length' is of type: uint8
1 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
dullbananas commented 3 years ago

I upgraded to nim v1.4.4 and there's now just 1 error:

/home/codespace/.nimble/pkgs/zippy-0.5.5/zippy/bitstreams.nim(54, 5) Error: undeclared identifier: 'copyMem'
guzba commented 3 years ago

Ah, Zippy does not support targeting Javascript.

guzba commented 3 years ago

Closing as merged with https://github.com/guzba/zippy/issues/17