properly bound with StaticValue or StaticType<MaskType: StaticType>

This commit is contained in:
Jacob Lifshay 2024-07-30 20:25:37 -07:00
parent 2dce478d48
commit cd99dbc849
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
8 changed files with 37 additions and 45 deletions

View file

@ -13,7 +13,7 @@ use fayalite::{
module::transform::simplify_enums::{simplify_enums, SimplifyEnumsKind},
reset::{SyncReset, ToReset},
source_location::SourceLocation,
ty::{StaticType, Value},
ty::{StaticValue, Value},
};
use serde_json::json;
@ -195,7 +195,7 @@ circuit check_array_repeat_1:
#[hdl_module(outline_generated)]
pub fn check_skipped_generics<T, #[hdl(skip)] U, const N: usize, #[hdl(skip)] const M: usize>(v: U)
where
T: Value<Type: StaticType<Value = T>>,
T: StaticValue,
U: std::fmt::Display,
{
dbg!(M);

View file

@ -1,6 +1,9 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
use fayalite::{int::UInt, ty::Value};
use fayalite::{
int::UInt,
ty::{StaticValue, Value},
};
#[derive(Value, Clone, Hash, PartialEq, Eq, Debug)]
#[hdl(outline_generated)]
@ -21,3 +24,9 @@ pub enum E<T> {
G(T),
H(T, UInt<1>),
}
#[derive(Value, Clone, Hash, PartialEq, Eq, Debug)]
#[hdl(outline_generated, static, where(T: StaticValue))]
pub struct S2<T> {
pub v: E<T>,
}