Skip to content

Add tests for static method dispatch on interface-typed values #10148

@jvepsalainen-nv

Description

@jvepsalainen-nv

Problem

Dynamic dispatch of static methods called directly on interface-typed values (obj.staticMethod() syntax) has no dedicated test coverage. Existing tests only cover the generic T::staticMethod() pattern and associated-type static methods, but not the case where a static method is called on an interface-typed value whose concrete type is unknown at compile time.

Additionally, accessing static const members through dynamic dispatch causes an internal compiler error (ICE 99999) on both HLSL and SPIRV targets, which is undocumented.

Proposed Solution

Add test coverage for:

  1. Static method dynamic dispatch - Verify that static methods called on interface-typed values produce correct runtime results when the concrete type is resolved at runtime. Cover mixed static and instance method dispatch on the same interface, and verify the compiler reports the expected dynamic dispatch sites. Target multiple backends (dx12, vk, cuda, mtl).

  2. Static const with dynamic dispatch - Document the ICE when accessing static const interface members through dynamic dispatch, both via direct interface-typed values and via generic parameters. Tests should be disabled until the compiler either supports this or produces a proper diagnostic.

Related

  • ICE with static const in dynamic dispatch should be tracked separately (compiler emits internal error 99999: unexpected IR opcode during code emit)

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions