delef / maxminddb.cr

MaxMind DB Reader for Crystal
MIT License
23 stars 5 forks source link

undefined constant Any::Type #11

Closed jgillich closed 4 years ago

jgillich commented 4 years ago

Not sure if this was surfaced by Crystal 0.35 or just nobody noticed so far, but:

https://github.com/delef/maxminddb.cr/blob/4eb492e71d516e44a6adc2f1a9ac0dce50bbefd7/src/maxminddb/decoder.cr#L31

Any::Type was removed in https://github.com/delef/maxminddb.cr/commit/b2098063330b5c71df0817f2de586a0f23af6b1e.

 13 | GeoIP2.open(io)
             ^---
Error: instantiating 'GeoIP2:Module#open(IO::Memory)'

In lib/geoip2/src/geoip2.cr:7:14

 7 | Database.new(db, locales)
              ^--
Error: instantiating 'GeoIP2::Database.class#new(IO::Memory, Array(String))'

In lib/geoip2/src/geoip2/database.cr:7:27

 7 | @reader = MaxMindDB.open(db)
                         ^---
Error: instantiating 'MaxMindDB:Module#open(IO::Memory)'

In lib/maxminddb/src/maxminddb.cr:12:12

 12 | Reader.new(input, cache_max_size)
             ^--
Error: instantiating 'MaxMindDB::Reader.class#new(IO::Memory, Nil)'

In lib/maxminddb/src/maxminddb/reader.cr:23:26

 23 | @metadata = Metadata.new(@buffer)
                           ^--
Error: instantiating 'MaxMindDB::Metadata.class#new(MaxMindDB::Buffer)'

In lib/maxminddb/src/maxminddb/metadata.cr:70:50

 70 | metadata = Decoder.new(buffer, start_offset).decode(start_offset).as_any
                                                   ^-----
Error: instantiating 'MaxMindDB::Decoder#decode(Int32)'

In lib/maxminddb/src/maxminddb/decoder.cr:57:5

 57 | decode
      ^-----
Error: instantiating 'decode()'

In lib/maxminddb/src/maxminddb/decoder.cr:66:5

 66 | decode_by_type(data_type, size)
      ^-------------
Error: instantiating 'decode_by_type(MaxMindDB::Decoder::DataType, Int32)'

In lib/maxminddb/src/maxminddb/decoder.cr:78:7

 78 | decode_pointer(size)
      ^-------------
Error: instantiating 'decode_pointer(Int32)'

In lib/maxminddb/src/maxminddb/decoder.cr:149:17

 149 | return Node.new(pointer) if @pointer_test
                   ^--
Error: instantiating 'MaxMindDB::Decoder::Node.class#new(Int32)'

In lib/maxminddb/src/maxminddb/decoder.cr:31:29

 31 | def initialize(@value : Any::Type)
                              ^
Error: undefined constant Any::Type
delef commented 4 years ago

Thanks!