jakt icon indicating copy to clipboard operation
jakt copied to clipboard

C++ error message: no matching function for call to 'verify_cast'

Open mnlrsn opened this issue 2 years ago • 1 comments

The error is produced by compiling the following snippet:

function main() {
    let arr : [f32] = [0f32] as! [f32]
}

Jakt compilation does not produce any errors, but clang emits this output:

 error: no matching function for call to 'verify_cast'
        const Array<f32> arr = (verify_cast<Array<f32>>((Array({static_cast<i64>(0LL)}))));
                                ^~~~~~~~~~~~~~~~~~~~~~~
../../jakt/runtime/AK/TypeCasts.h:47:49: note: candidate function [with OutputType = AK::Array<float>, InputType = AK::Array<long>] not viable: expects an l-value for 1st argument
ALWAYS_INLINE CopyConst<InputType, OutputType>& verify_cast(InputType& input)
                                                ^
../../jakt/runtime/AK/TypeCasts.h:39:49: note: candidate template ignored: could not match 'InputType *' against 'AK::Array<long>'
ALWAYS_INLINE CopyConst<InputType, OutputType>* verify_cast(InputType* input)

mnlrsn avatar May 24 '22 06:05 mnlrsn

Hi I would like to work on this issue.

varunkumare99 avatar Sep 01 '22 15:09 varunkumare99