type checking on environment construction