We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a37a1c0 + 4e3cb91 commit a1b0ce2Copy full SHA for a1b0ce2
crates/static-analysis-kernel/src/analysis/languages/csharp/using_directives.rs
@@ -137,8 +137,17 @@ pub fn parse_using_with_tree<'text>(
137
}
138
139
140
- let namespace = qualified_namespace
141
- .expect("grammar structure invariant: this should have been populated");
+ // Hotfix:
+ // The above parser does not handle cases like
142
+ // using (var resource = new ResourceType())
143
+ // {
144
+ // // ...
145
+ // }
146
+ //
147
+ // In this case, we just set the qualified namespace to "".
148
149
+ // This should be revisited.
150
+ let namespace = qualified_namespace.unwrap_or_default();
151
usings.push(Using { namespace, alias })
152
153
usings
0 commit comments