From 98b2cbc9cbba35da2691f861ef555b45e7ddccc4 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 6 Aug 2019 23:20:23 -0600 Subject: [PATCH] Fix type inference --- src/spectator/matchers/array_matcher.cr | 4 ++-- src/spectator/matchers/value_matcher.cr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectator/matchers/array_matcher.cr b/src/spectator/matchers/array_matcher.cr index acbf26d..e19153e 100644 --- a/src/spectator/matchers/array_matcher.cr +++ b/src/spectator/matchers/array_matcher.cr @@ -7,9 +7,9 @@ module Spectator::Matchers # Matcher for checking that the contents of one array (or similar type) # has the exact same contents as another and in the same order. struct ArrayMatcher(ExpectedType) < Matcher - private getter expected : TestValue(ExpectedType) + private getter expected - def initialize(@expected) + def initialize(@expected : TestValue(Enumerable(ExpectedType))) end def description diff --git a/src/spectator/matchers/value_matcher.cr b/src/spectator/matchers/value_matcher.cr index fc00c42..0710918 100644 --- a/src/spectator/matchers/value_matcher.cr +++ b/src/spectator/matchers/value_matcher.cr @@ -6,11 +6,11 @@ module Spectator::Matchers abstract struct ValueMatcher(ExpectedType) < StandardMatcher # Expected value. # Sub-types may use this value to test the expectation and generate message strings. - private getter expected : TestValue(ExpectedType) + private getter expected # Creates the value matcher. # The expected value is stored for later use. - def initialize(@expected) + def initialize(@expected : TestValue(ExpectedType)) end private def values(actual)