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

multiple argument functions fail on AST lowering pass #83

Open
EmilySillars opened this issue Feb 22, 2022 · 0 comments
Open

multiple argument functions fail on AST lowering pass #83

EmilySillars opened this issue Feb 22, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@EmilySillars
Copy link
Contributor

When writing a SSLANG source program, if I define a function with multiple arguments, the lowerAst IR pass throws an error. Below is an example of this behavior.
Example program:

type Color
  RGB Int Int Int  
  CMYK Int Int Int Int
  White
  Black
  Sparkly


// main (brush : & Color)-> () =

main ( cout : &Int , brush : &Color)-> () = // fails
  brush <- RGB 192 192 192
  // draw brush       
  brush <- Black
  // draw brush
  brush <- RGB 204 255 204
  // draw  brush
  ()

Error ouput from runtests.log:

###### Testing colors
stack exec sslc -- tests/colors.ssl > out/colors.c
sslc: pattern should be desguared into pattern match
CallStack (from HasCallStack):
  error, called at src/IR/LowerAst.hs:225:18 in sslang-0.1.0.0-4TMoE2od9JzCqrGeolufpl:IR.LowerAst
###### FAILED
@EmilySillars EmilySillars added the bug Something isn't working label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant