MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / check_variant

Method check_variant

aiscript-vm/src/ty/enum.rs:31–39  ·  view source on GitHub ↗
(&mut self, variant_name: Token<'gc>)

Source from the content-addressed store, hash-verified

29 }
30
31 pub(crate) fn check_variant(&mut self, variant_name: Token<'gc>) -> Result<(), String> {
32 if !self.variant_names.insert(variant_name.lexeme) {
33 return Err(format!(
34 "Duplicate variant '{}' in enum '{}'.",
35 variant_name.lexeme, self.enum_name
36 ));
37 }
38 Ok(())
39 }
40
41 pub(crate) fn check_value(
42 &mut self,

Callers 1

enum_declarationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected