Skip to content

No compiler error when attempting to use voidptr as type argument #19224

@Choosechee

Description

@Choosechee

Using voidptr as a type argument does not cause a compiler error, even though it is invalid and causes a BadImageFormatException or TypeLoadException at runtime.

Repro steps

  1. Use voidptr as a type argument, e.g:
let badList: voidptr list = []
printf "%A" badList
  1. Compile.

Expected behavior

An error, preventing compilation. This happens in C# with void*.

Actual behavior

No compilation error, but errors at runtime.

Known workarounds

Don't try to use voidptr as a generic type argument.

Related information

  • Operating system: Kubuntu 25.10
  • .NET Runtime kind: .NET 10
  • Editing Tools: JetBrains Rider 2025.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions