# Error in multiple dispatch

**URL:** <https://discourse.julialang.org/t/error-in-multiple-dispatch/124239>\
**Category:** New to Julia\
**Created:** [December 29, 2024, 2:34am UTC](https://discourse.julialang.org/t/error-in-multiple-dispatch/124239 "2024-12-29T02:34:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [December 29, 2024, 6:00am UTC](https://discourse.julialang.org/t/error-in-multiple-dispatch/124239/3 "2024-12-29T06:00:32Z")

</div>

Hi,  
in super short: Multiple dispatch does not work for keyword arguments, see also [Using Multiple Dispatch with Keyword Arguments](https://discourse.julialang.org/t/using-multiple-dispatch-with-keyword-arguments/87343)

What I assume is happening here is, that you second definition is not an additional one, but it _redefines_ (hence replaces) the zero-argument constructor If you switch both definitions, the float one will work, the quantity one will not.

You could use positional arguments instead

---

_[View the full topic](https://discourse.julialang.org/t/error-in-multiple-dispatch/124239)._
