HlslTools
HlslTools copied to clipboard
Live Error throws false positive HLSL0039 on converting inhereted struct to base type
Repro: Declare a struct type Foo, then another struct type Bar which inherits from it. Create an instance of Bar and attempt to cast it to Foo.
struct Foo
{
int testy;
};
struct Bar : Foo
{
int testo;
};
Output Main(Input input)
{
Bar thingy = (Bar)0;
(Foo)thingy;
...
}
Expected: thingy is successfully casted to Foo and throws no error
Actual: Live Error throws Cannot convert type 'Bar' to 'Foo'.Shader Tools(HLSL0039)