{"record":{"id":"2877a7d8b34466d1","repo":"dotnet/runtime","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mono/browser/runtime/marshal-to-cs.ts","lineNumber":512,"sourceCode":"            const targetView = localHeapViewU8().subarray(<any>buffer_ptr, buffer_ptr + length);\n            targetView.set(value);\n        } else if (element_type == MarshalerType.Int32) {\n            mono_check(Array.isArray(value) || value instanceof Int32Array, \"Value is not an Array or Int32Array\");\n            const bufferOffset = fixupPointer(buffer_ptr, 2);\n            const targetView = localHeapViewI32().subarray(bufferOffset, bufferOffset + length);\n            targetView.set(value);\n        } else if (element_type == MarshalerType.Double) {\n            mono_check(Array.isArray(value) || value instanceof Float64Array, \"Value is not an Array or Float64Array\");\n            const bufferOffset = fixupPointer(buffer_ptr, 3);\n            const targetView = localHeapViewF64().subarray(bufferOffset, bufferOffset + length);\n            targetView.set(value);\n        } else if (element_type == MarshalerType.Single) {\n            mono_check(Array.isArray(value) || value instanceof Float32Array, \"Value is not an Array or Float32Array\");\n            const bufferOffset = fixupPointer(buffer_ptr, 2);\n            const targetView = localHeapViewF32().subarray(bufferOffset, bufferOffset + length);\n            targetView.set(value);\n        } else {\n            throw new Error(\"not implemented\");\n        }\n        set_arg_intptr(arg, buffer_ptr);\n        set_arg_type(arg, MarshalerType.Array);\n        set_arg_element_type(arg, element_type);\n        set_arg_length(arg, value.length);\n    }\n}\n\nfunction _marshal_span_to_cs (arg: JSMarshalerArgument, value: Span, element_type?: MarshalerType): void {\n    mono_assert(!!element_type, \"Expected valid element_type parameter\");\n    mono_check(!value.isDisposed, \"ObjectDisposedException\");\n    checkViewType(element_type, value._viewType);\n\n    set_arg_type(arg, MarshalerType.Span);\n    set_arg_intptr(arg, value._pointer);\n    set_arg_length(arg, value.length);\n}\n","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/mono/browser/runtime/marshal-to-cs.ts#L494-L530","documentation":"Thrown by marshal_array_to_cs_impl() as the final else when the array element_type does not match any supported type (String, Object, JSObject, Byte, Int32, Double, Single). The function iterates through known element types and throws 'not implemented' for anything unrecognized. This is a low-level marshaling error indicating the array marshaler received an element type it was not built to handle.","triggerScenarios":"Calling marshal_array_to_cs or marshal_array_to_cs_impl with an element_type that is not one of: String, Object, JSObject, Byte, Int32, Double, or Single. This is typically caused by a C# signature that uses an unsupported array element type, or by internal marshaler binding logic producing an unrecognized type code.","commonSituations":"Declaring a C# JSImport/JSExport with an array parameter of an unsupported element type (e.g., char[], short[], decimal[], long[]). A mismatch between the C# signature and the JS values being marshaled. Internal type-resolution issues from an outdated or mismatched runtime build.","solutions":["Use a supported array element type on the C# side: string[], object[], byte[], int[], double[], or float[].","For long[], change the C# parameter type and use long[] with the BigInt64 marshaler, or convert to int[] if values fit.","For char[] or short[], convert to byte[] or int[] on the JS side before passing.","Ensure your dotnet runtime and C# assemblies are from the same version/build to avoid marshaler type mismatches."],"exampleFix":"// before (unsupported array element type)\n// C#: [JSExport] public static void Process(char[] data) { }\n\n// after (use supported type)\n// C#: [JSExport] public static void Process(int[] data) { }\n// JS:  Process(Array.from(charArray, c => c.charCodeAt(0)));","handlingStrategy":"validation","validationCode":"// Validate array element type before marshaling\nconst supportedArrayElementTypes = new Set(['String', 'Object', 'JSObject', 'Byte', 'Int32', 'Double', 'Single']);\nfunction isSupportedArrayElementType(type: string): boolean {\n  return supportedArrayElementTypes.has(type);\n}\n\n// Ensure C# uses supported array element types\n// char[] -> int[], short[] -> int[], decimal[] -> double[], etc.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use supported array element types: string[], int[], byte[], double[], float[], object[].","Convert unsupported types (char[], short[], bool[], long[]) to supported types before interop.","Keep the C# interop signatures and JS runtime package version-aligned."],"tags":["marshaling","array","type-mismatch","interop"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}