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

Panic using global names in roto script #55

Open
DRiKE opened this issue Aug 20, 2024 · 0 comments
Open

Panic using global names in roto script #55

DRiKE opened this issue Aug 20, 2024 · 0 comments

Comments

@DRiKE
Copy link
Contributor

DRiKE commented Aug 20, 2024

Based on the big-overhaul branch, a4002c5

Not quite sure whether I'm using this as intended, but including any of the uppercase global names as defined in fn typechecker::types::globals(..) causes a panic a la

did not find Var { scope: ScopeRef(None), kind: Explicit(Identifier(SymbolU32 { value: 5 })) } in { ...
#[test]
fn issue_5() {
    let rt = Runtime::basic().unwrap();

    let s = r#"
        filter-map main() {
            define {
                safi = Safi.Unicast;
            }
            apply {
                //  this panics at codegen/mod.rs:634:
                //  "did not find Var { ... }
                if safi == UNICAST {

                // this works however:
                //if safi == Safi.Unicast {

                    reject
                }
                accept

            }
        }
    "#;

    let _p = compile(s, rt);
}
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