Issue Description
As the topic says.
Reproducer Code
RWStructuredBuffer<int64_t> output;
void computeMain()
{
let str : String = "123";
output[0] = str.getLength();
}
slangc -target cpp -stage compute -entry computeMain test.slang -o test.cc
g++ test.cc
Expected Behavior
Slang should generate C++ code that writes 3 in the output buffer.
Actual Behavior
Invalid C++ code generated:
void _computeMain(void* _S1, void* entryPointParams_0, void* globalParams_0)
{
int64_t * _S2 = (&((slang_bit_cast<GlobalParams_0*>(globalParams_0))->output_0)[int(0)]);
#line 6
int64_t _S3 = "123".getLength(); // <<<<<<<<<<< ERROR HERE
#line 6
*_S2 = _S3;
return;
}
Environment
- Slang Version: commit 7369773
- OS: Ubuntu 24.04 LTS
Additional context
This is likely related to issue #8917. Using NativeString instead of String produces code that compiles and looks correct. Due to the lack of documentation in the user guide and the standard module reference, it is unclear whether the reproducer code is correct or not. If it should work, there is probably something missing in IR lowering.
Issue Description
As the topic says.
Reproducer Code
Expected Behavior
Slang should generate C++ code that writes
3in the output buffer.Actual Behavior
Invalid C++ code generated:
Environment
Additional context
This is likely related to issue #8917. Using
NativeStringinstead ofStringproduces code that compiles and looks correct. Due to the lack of documentation in the user guide and the standard module reference, it is unclear whether the reproducer code is correct or not. If it should work, there is probably something missing in IR lowering.