Crystal: ICE Bug: `def refill_in_buffer [...]` in crystal/src/io/encoding.cr:123:13 has no type

Created on 27 Jan 2017  路  3Comments  路  Source: crystal-lang/crystal

Crystal version :
Crystal 0.20.4 [d1f8c42f8] (2017-01-27)
Crystal 0.20.5+2 [15032ccf2] (2017-01-27)

Full stack trace and macro generated :
https://gist.github.com/TechMagister/9f70c1fa0fa61a96a521f19336c61a0e

Code to reproduce ( sorry, I have no time to reduce this for the moment :/ ):
https://github.com/TechMagister/cracker/tree/ice

bug accepted compiler

Most helpful comment

Reduced code :

require "cli"
require "json"

class Command
    JSON.mapping({
      content: String
    })
end



class Main < Cli::Supercommand
    class Server < Cli::Command
      def run
        Command.from_json("")
      end
    end
end

Main.run ARGV
shards:
  callback:
    github: mosop/callback
    version: 0.6.2

  cli:
    github: mosop/cli
    version: 0.6.4

  optarg:
    github: mosop/optarg
    version: 0.5.4

  string_inflection:
    github: mosop/string_inflection
    version: 0.2.0

All 3 comments

Please if you find the time to write a reduced code snippet to reproduce it do so. It drastically increases the odds of having it fixed :).

Reduced code :

require "cli"
require "json"

class Command
    JSON.mapping({
      content: String
    })
end



class Main < Cli::Supercommand
    class Server < Cli::Command
      def run
        Command.from_json("")
      end
    end
end

Main.run ARGV
shards:
  callback:
    github: mosop/callback
    version: 0.6.2

  cli:
    github: mosop/cli
    version: 0.6.4

  optarg:
    github: mosop/optarg
    version: 0.5.4

  string_inflection:
    github: mosop/string_inflection
    version: 0.2.0

Here's a gist to repro the issue (git clone https://gist.github.com/2ca75369657a70b24217cd8b36b482d8.git).

(Thanks for the sample, @TechMagister!)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asterite picture asterite  路  3Comments

cjgajard picture cjgajard  路  3Comments

will picture will  路  3Comments

ArthurZ picture ArthurZ  路  3Comments

Sija picture Sija  路  3Comments