todo: arbitrary ir

This commit is contained in:
2023-12-03 17:32:37 -08:00
parent 93cac44a99
commit 2c2268925a
16 changed files with 298 additions and 163 deletions

21
src/ir/arbitrary.rs Normal file
View File

@@ -0,0 +1,21 @@
use crate::ir::{Program, TopLevel, Expression, ValueOrRef, Value, Type};
use proptest::{
prelude::Arbitrary,
strategy::{BoxedStrategy, Strategy},
};
impl<Type: core::fmt::Debug> Arbitrary for Program<Type> {
type Parameters = crate::syntax::arbitrary::GenerationEnvironment;
type Strategy = BoxedStrategy<Self>;
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
unimplemented!()
//crate::syntax::Program::arbitrary_with(args)
// .prop_map(|x| {
// x.type_infer()
// .expect("arbitrary_with should generate type-correct programs")
// })
// .boxed()
}
}