Created
February 2, 2017 22:54
-
-
Save thbar/92c2deaa5422b6fccb98a1132c333882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./spec_helper" | |
alias ConfigValue = String | Int32 | |
alias Config = Hash(Symbol, ConfigValue) | |
class SomeSource | |
@filename : String | |
def initialize(options : Config) | |
@filename = options[:filename] | |
end | |
end | |
c = Config.new | |
c[:filename] = "spec/fixtures/sample.csv" | |
source = SomeSource.new(c) | |
# Error in line 2: while requiring "./spec/repro_spec.cr" | |
# | |
# in spec/repro_spec.cr:16: instantiating 'SomeSource:Class#new(Hash(Symbol, Int32 | String))' | |
# | |
# source = SomeSource.new(c) | |
# ^~~ | |
# | |
# in spec/repro_spec.cr:10: instance variable '@filename' of SomeSource must be String, not (Int32 | String) | |
# | |
# @filename = options[:filename] | |
# ^~~~~~~~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment