# \#diagonal-rule

**URL:** https://discourse.julialang.org/tag/diagonal-rule/1727.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Method ambiguity involving diagonal types](https://discourse.julialang.org/t/method-ambiguity-involving-diagonal-types/133907)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 10\
**Last updated:** [November 18, 2025, 8:53am UTC](https://discourse.julialang.org/t/method-ambiguity-involving-diagonal-types/133907 "2025-11-18T08:53:59Z")

</div>

MWE: julia\> f1(argL::T, argR::T) where {T} = 1 f1 (generic function with 1 method) julia\> f1(argL::T1, argR::T2) where {T, T1\<:AbstractArray{T}, T2\<:AbstractArray{T}} = 2 f1 (generic function with 2 methods) julia\> f1…

---

## [Unassigned type parameters in \`UnionAll\` of \`Tuple\` do not refer to concrete types in edge cases](https://discourse.julialang.org/t/unassigned-type-parameters-in-unionall-of-tuple-do-not-refer-to-concrete-types-in-edge-cases/125217)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 5\
**Last updated:** [January 30, 2025, 8:14am UTC](https://discourse.julialang.org/t/unassigned-type-parameters-in-unionall-of-tuple-do-not-refer-to-concrete-types-in-edge-cases/125217 "2025-01-30T08:14:13Z")

</div>

Consider a simple example where I define a type alias for (non-empty) Tuple: julia\> const MyTuple1{T, N} = Tuple{T, Vararg{T, N}} Tuple{T, Vararg{T, N}} where {T, N} Even when the type parameter T is not assigned, the U…

---

## [Problem with parametric composite types](https://discourse.julialang.org/t/problem-with-parametric-composite-types/108222)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [January 1, 2024, 11:13am UTC](https://discourse.julialang.org/t/problem-with-parametric-composite-types/108222 "2024-01-01T11:13:10Z")

</div>

I defined a type: struct Point{T} x :: T y :: T end Then when I tried to construct an variable b = Point(1.0, 2) I got ERROR: MethodError: no method matching Point(::Float64, ::Int64) Closest candidates are: P…

---

## [How to dispatch on a Tuple with unknown length, but elements have same abstract type?](https://discourse.julialang.org/t/how-to-dispatch-on-a-tuple-with-unknown-length-but-elements-have-same-abstract-type/93017)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 4\
**Last updated:** [January 16, 2023, 11:42am UTC](https://discourse.julialang.org/t/how-to-dispatch-on-a-tuple-with-unknown-length-but-elements-have-same-abstract-type/93017 "2023-01-16T11:42:33Z")

</div>

Consider this example: a = (complex(1,2), complex(1.0, 2.0)) The length of a is not fixed to 2, but could be arbitrary. Is there a way to dispatch on this? I tried a isa NTuple{N, \<: Complex} where N but this is ob…
