Top Level StringLiteral constants
- Dominant language
- JavaScript
- Stars
- 4.6k
- Forks
- 119
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Overview
Top level StringLiterals fail validation, they should not. Instead, they should compile out to a constant i32 pointer to the data location for a string.
## Expected
Top level strings are allowed
## Actual
Strings in top-level constants throw validation warnings.
## Example
```js
const memory: Memory<{ initial: 1 }>;
const myString: i32 = 'hello world';
export function test(): i32 {
return myString;
}
```
Contributor guide
Research direction
No source files or tests are named. Start by reproducing the JavaScript example and tracing validation of top-level constants and StringLiterals; compare the generated WebAssembly representation with the expected i32 pointer to string data. Done means the example compiles without validation warnings and the exported function returns the string pointer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100