I am having problems with an implicit casting operator that works fine inside the assembly, where the type is declared, but is not used when using external programs / libraries that reference the original assembly.
Suppose I have this structure:
public readonly struct Tensor
{
public readonly IntPtr Ptr;
public static unsafe implicit operator float*(in Tensor tensor) => (float*)tensor.Ptr.ToPointer();
}
This works great when used with the same build, i.e. I can do:
float* p = t;
But if I try to do the same from another program / something referencing the assembly Tensor
is defined, the compiler does not say:
error CS0029: Failed to implicitly convert the type "Tensor" to "float *"
The strange thing is that Visual Studio does not show any error in the IDE itself, everything looks fine there:

, , , .
:
!
EDIT: , : https://github.com/Sergio0694/NeuralNetwork.NET
Tensor
NeuralNetwork.NET APIs\Structs. , .
№ 2: , : https://github.com/dotnet/roslyn/issues/23945 p >