# Where {T\<:ConcreteType}

**URL:** https://discourse.julialang.org/t/where-t-concretetype/11002
**Category:** General Usage
**Created:** [May 18, 2018, 7:36pm UTC](https://discourse.julialang.org/t/where-t-concretetype/11002 "2018-05-18T19:36:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)
#### Post date: [May 18, 2018, 7:36pm UTC](https://discourse.julialang.org/t/where-t-concretetype/11002/1 "2018-05-18T19:36:38Z")

</div>

Should n’t the two methods of `f` in the example below conflict?

```julia
abstract type AbstractA end
struct A <: AbstractA
    data::Int
end
f(a::T) where {T<:A} = (T, a.data)
f(A(2))
# (A, 2)
f(a::A) = ("A", a.data)
f(A(2))
# ("A", 2)

```

I also see that when the methods are declared in the reverse order the second one does not have any effect.

```julia
abstract type AbstractA end
struct A <: AbstractA
    data::Int
end
f(a::A) = ("A", a.data)
f(A(2))
# ("A", 2)
f(a::T) where {T<:A} = (T, a.data)
f(A(2))
# ("A", 2)

```

When is the latter invoked ever?

---

<div class="post-metadata">

### Author: ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)
#### Post date: [May 18, 2018, 7:41pm UTC](https://discourse.julialang.org/t/where-t-concretetype/11002/2 "2018-05-18T19:41:20Z")

</div>

My understanding is that the latter will never be invoked because it is being “masked” by the former. Ideally it would give some sort of warning when you define the latter, but I don’t know how complicated it would be to do the code analysis necessary to generate the appropriate warnings in the general case.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [May 18, 2018, 7:43pm UTC](https://discourse.julialang.org/t/where-t-concretetype/11002/3 "2018-05-18T19:43:18Z")

</div>

> [@ExpandingMan](#):
>
> Ideally it would give some sort of warning when you define the latter, but I don’t know how complicated it would be to do the code analysis necessary to generate the appropriate warnings in the general case.

It used to. The warnings got intentionally removed except for when precompiling.
