Revert "fixing more pair issues"
This reverts commit b76cc7436294cd73e7bbaf656c76a8f8b0ad56a9.
This commit is contained in:
		
							parent
							
								
									46c7cb797a
								
							
						
					
					
						commit
						3dd94983bd
					
				| 
						 | 
					@ -342,19 +342,6 @@ impl TypedDataType {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pub fn pair(fst_tipo: Rc<Type>, snd_tipo: Rc<Type>) -> Self {
 | 
					 | 
				
			||||||
        DataType {
 | 
					 | 
				
			||||||
            constructors: vec![],
 | 
					 | 
				
			||||||
            doc: None,
 | 
					 | 
				
			||||||
            location: Span::empty(),
 | 
					 | 
				
			||||||
            name: "Pair".to_string(),
 | 
					 | 
				
			||||||
            opaque: false,
 | 
					 | 
				
			||||||
            parameters: vec!["a".to_string(), "b".to_string()],
 | 
					 | 
				
			||||||
            public: true,
 | 
					 | 
				
			||||||
            typed_parameters: vec![fst_tipo, snd_tipo],
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pub fn bool() -> Self {
 | 
					    pub fn bool() -> Self {
 | 
				
			||||||
        DataType {
 | 
					        DataType {
 | 
				
			||||||
            constructors: vec![
 | 
					            constructors: vec![
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1328,17 +1328,6 @@ pub fn prelude_data_types(id_gen: &IdGenerator) -> IndexMap<DataTypeKey, TypedDa
 | 
				
			||||||
        bool_data_type,
 | 
					        bool_data_type,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let pair_data_type =
 | 
					 | 
				
			||||||
        TypedDataType::pair(generic_var(id_gen.next()), generic_var(id_gen.next()));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    data_types.insert(
 | 
					 | 
				
			||||||
        DataTypeKey {
 | 
					 | 
				
			||||||
            module_name: "".to_string(),
 | 
					 | 
				
			||||||
            defined_type: "Pair".to_string(),
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        pair_data_type,
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Option
 | 
					    // Option
 | 
				
			||||||
    let option_data_type = TypedDataType::option(generic_var(id_gen.next()));
 | 
					    let option_data_type = TypedDataType::option(generic_var(id_gen.next()));
 | 
				
			||||||
    data_types.insert(
 | 
					    data_types.insert(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -649,12 +649,6 @@ impl<'a> CodeGenerator<'a> {
 | 
				
			||||||
                } => {
 | 
					                } => {
 | 
				
			||||||
                    if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
 | 
					                    if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
 | 
				
			||||||
                        self.build(record, module_build_name, &[])
 | 
					                        self.build(record, module_build_name, &[])
 | 
				
			||||||
                    } else if record.tipo().is_pair() {
 | 
					 | 
				
			||||||
                        AirTree::pair_index(
 | 
					 | 
				
			||||||
                            usize::try_from(*index).unwrap(),
 | 
					 | 
				
			||||||
                            tipo.clone(),
 | 
					 | 
				
			||||||
                            self.build(record, module_build_name, &[]),
 | 
					 | 
				
			||||||
                        )
 | 
					 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        let function_name = format!("__access_index_{}", *index);
 | 
					                        let function_name = format!("__access_index_{}", *index);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -653,15 +653,6 @@ pub fn lookup_data_type_by_tipo(
 | 
				
			||||||
                None
 | 
					                None
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        Type::Pair { .. } => {
 | 
					 | 
				
			||||||
            let data_type_key = DataTypeKey {
 | 
					 | 
				
			||||||
                module_name: "".to_string(),
 | 
					 | 
				
			||||||
                defined_type: "Pair".to_string(),
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            data_types.get(&data_type_key).cloned().cloned()
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        _ => None,
 | 
					        _ => None,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue