basic semantic type checking