Fix handling of standalone .cbor and tagged types#112
Fix handling of standalone .cbor and tagged types#112SebastienGllmt wants to merge 3 commits intomasterfrom
Conversation
| fn has_embed<'a>(parent_visitor: &'a ParentVisitor, rule: &Rule<'a>) -> bool { | ||
| _has_embed(parent_visitor, &CDDLType::from(rule)) | ||
| } | ||
| fn _has_embed<'a, 'b>(parent_visitor: &'a ParentVisitor, cddl_type: &CDDLType<'a, 'b>) -> bool { |
There was a problem hiding this comment.
I wouldn't use this name as _ prefixes in rust are to signify they're unused.
| .expect(&format!("Please move definition for {} above {}", type_name, ident)); | ||
| types.register_type_alias(type_name.clone(), RustType::Tagged(tag_unwrap, Box::new(base_type)), true, true); | ||
| if has_embed(parent_visitor, get_rule(parent_visitor, &CDDLType::from(&inner_type.type1.type2))) { | ||
| types.register_type_alias(type_name.clone(), RustType::Tagged(tag_unwrap, Box::new(base_type)), false, true); |
There was a problem hiding this comment.
This will need a minor change for conflict with #111
| || self.rust_structs.contains_key(ident) | ||
| || self.generic_defs.contains_key(ident) | ||
| || self.generic_instances.contains_key(ident) | ||
| } |
There was a problem hiding this comment.
FYI the code removed in this file is all unused. It comes from a previous PR that I forgot to delete and it didn't work because has_ident isn't stable across passes of the parsing.rs
|
The error it fails with is in one of the unit tests. It's treating the test that's: in the Before we considered that anywhere taking in |
fe6ec0e to
f78cd04
Compare
|
TODO: somebody needs to go through and check if this PR is still necessary (other than the commit that deletes unused code) given #117 was merged |
Fix #91
Currently this fails with the following error that I don't really understand