Skip to content

Commit

Permalink
Revert "fixing more pair issues"
Browse files Browse the repository at this point in the history
This reverts commit b76cc74.
  • Loading branch information
KtorZ authored and MicroProofs committed May 3, 2024
1 parent a7abbea commit 403b4ca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
13 changes: 0 additions & 13 deletions crates/aiken-lang/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
DataType {
constructors: vec![
Expand Down
11 changes: 0 additions & 11 deletions crates/aiken-lang/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1328,17 +1328,6 @@ pub fn prelude_data_types(id_gen: &IdGenerator) -> IndexMap<DataTypeKey, TypedDa
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
let option_data_type = TypedDataType::option(generic_var(id_gen.next()));
data_types.insert(
Expand Down
6 changes: 0 additions & 6 deletions crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,6 @@ impl<'a> CodeGenerator<'a> {
} => {
if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
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 {
let function_name = format!("__access_index_{}", *index);

Expand Down
9 changes: 0 additions & 9 deletions crates/aiken-lang/src/tipo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,6 @@ pub fn lookup_data_type_by_tipo(
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,
}
}
Expand Down

0 comments on commit 403b4ca

Please sign in to comment.