add tests for variant
impl resolve patterns
fix compiling constructor with arguments