# Inconsistency in TypeError message?

**URL:** <https://discourse.julialang.org/t/inconsistency-in-typeerror-message/33256>\
**Category:** General Usage\
**Created:** [January 12, 2020, 1:05am UTC](https://discourse.julialang.org/t/inconsistency-in-typeerror-message/33256 "2020-01-12T01:05:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [January 12, 2020, 1:05am UTC](https://discourse.julialang.org/t/inconsistency-in-typeerror-message/33256/1 "2020-01-12T01:05:53Z")

</div>

I like the second error because it’s clear to me that which keyword argument was passed with wrong type…

```julia
julia> function foo(a, b; x::Bool = true, y::String = "abc")
           println("hello")
           x ? a + b : y
       end

julia> foo(1,2; x = 1)
ERROR: TypeError: non-boolean (Int64) used in boolean context
Stacktrace:
 [1] (::var"#kw##foo")(::NamedTuple{(:x,),Tuple{Int64}}, ::typeof(foo), ::Int64, ::Int64) at ./none:0
 [2] top-level scope at REPL[16]:1

julia> foo(1,2; y = 2)
ERROR: TypeError: in keyword argument y, expected String, got Int64
Stacktrace:
 [1] (::var"#kw##foo")(::NamedTuple{(:y,),Tuple{Int64}}, ::typeof(foo), ::Int64, ::Int64) at ./none:0
 [2] top-level scope at REPL[17]:1

```
