Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartString -> CString doesn't error in match cases but causes incorrect C code #1242

Open
alex-s168 opened this issue Feb 13, 2025 · 0 comments

Comments

@alex-s168
Copy link
Contributor

I wish I could create a PR for once without first having to file issues lol

This doesn't error:

let .file-extension(path: CString): CString = (
   let dot = path.find-last(46_u8);
   match dot {
      Some{content=content} => path.substring(content + 1);
      None{} => "";
   }
);

but generates incorrect C code because "" is a SmartString, and the function should return a CString

Code to reproduce here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant