added type info to rules. Doesn't affect normal compilation, but helps static analysis later