# Julia incorrect with function argument

**URL:** https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520
**Category:** General Usage
**Tags:** question, function, cxxwrap
**Created:** [December 6, 2024, 12:27am UTC](https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520 "2024-12-06T00:27:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)
#### Post date: [December 6, 2024, 12:27am UTC](https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520/1 "2024-12-06T00:27:28Z")

</div>

Hi!  
Please help me to understand whats wrong with julia logic.  
The following code print out:

```julia
println(typeof(section))
>> CxxWrap.CxxWrapCore.CxxPtr{Main.CppTypes.ISection}

```

I wish to write function which take this (and i want to specify its type)  
Which also print same (obviously)

```julia
function Eg(mat, T::Cdouble)
    println(typeof(mat))
end
>> CxxWrap.CxxWrapCore.CxxPtr{Main.CppTypes.ISection}

```

But if i add this type - julia will not compile

```julia
function Eg(mat :: CxxWrap.CxxWrapCore.CxxPtr{Main.CppTypes.ISection}, T::Cdouble)
    println(typeof(mat))
end

```

Is it correct? I place a type typed by julia.  
I run julia through c++ binding and dont know the exact problem for this.

---

<div class="post-metadata">

### Author: ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)
#### Post date: [December 6, 2024, 12:33am UTC](https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520/2 "2024-12-06T00:33:47Z")

</div>

Sorry, im stupid. Found answer when writing this question.  
Should add

```julia
using CxxWrap

```

But how to know that from julia embedding?  
How to handle julia compile errors with embeddding?
