diff --git a/src/lnf.rs b/src/lnf.rs index 8acd421..f8b3ad9 100644 --- a/src/lnf.rs +++ b/src/lnf.rs @@ -41,7 +41,7 @@ impl TypeTerm { new_ladder.push( TypeTerm::App(vec![]) ); for arg in args_iter { - match arg.clone() { + match arg.normalize() { TypeTerm::Ladder(rungs) => { // duplicate last element for each rung let l = new_ladder.len(); diff --git a/src/test/lnf.rs b/src/test/lnf.rs index 486c0d6..1c81a55 100644 --- a/src/test/lnf.rs +++ b/src/test/lnf.rs @@ -43,5 +43,15 @@ fn test_normalize() { dict.parse("~Char>").expect("parse error").normalize(), dict.parse(">~").expect("parse errror"), ); + + + assert_eq!( + dict.parse(" F~G H H>").expect("parse error").normalize(), + dict.parse(" F H H> + ~ F H H> + ~ F H H> + ~ G H H>").expect("parse errror"), + ); + }