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

Invalid SDF3 source directory expression results in an exception #94

Closed
molenzwiebel opened this issue Nov 20, 2021 · 2 comments
Closed
Labels
C-Bug Category: bug. Not working as expected

Comments

@molenzwiebel
Copy link
Contributor

Summary

Setting an invalid main-source-directory in spoofaxc.cfg results in an exception.

What you did

sdf3 {
  source = files {
    main-source-directory = 1
  }
}

What you expected to happen

Statix error.

What actually happened

An internal error occurred during: "CFG editor update".
BUG: invalid AST shape, expected string or String/Path/JavaId/SortId/StrategyId application in AST: UInt("1"{TermIndex("eclipse-resource##/dynamix/spoofaxc.cfg",10)}){TermIndex("eclipse-resource##/dynamix/spoofaxc.cfg",11)}

Context

  • Spoofax version: devenv, spoofax-pie commit bb75f54
  • Operating system & version: Windows
@molenzwiebel molenzwiebel added the C-Bug Category: bug. Not working as expected label Nov 20, 2021
@Gohla
Copy link
Member

Gohla commented Nov 23, 2021

There's a whole class of errors like these. The issue is that the code that converts from the CFG to a configuration object runs regardless of whether the static semantics finds any errors. The reason for this is that I'd like to be able to produce a configuration object even in case of errors (i.e., error recovery).

However, that would require many error checks across the entire conversion code, so maybe this was a bad idea and this should be reverted. That would require splitting out errors that are produced on the Java side (e.g., whether directories/files exist) to separate code that does run alongside static semantics, and the conversion code which can assume that all checks have passed.

@Gohla
Copy link
Member

Gohla commented May 18, 2022

Fixed by b4a108e.

@Gohla Gohla closed this as completed May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants