Skip to content

Commit

Permalink
Added warning
Browse files Browse the repository at this point in the history
  • Loading branch information
IBims1NicerTobi committed Jan 14, 2025
1 parent ae210e4 commit d4f788f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/typing/template.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::Display;
use crate::{prelude::*, value::Value};
use super::{abstract_type::AbstractType, concrete_type::ConcreteType};
use crate::flattening::WrittenType;
use crate::{prelude::*, value::Value};
use std::fmt::Display;

/// References any [crate::flattening::Module], [crate::flattening::StructType], or [crate::flattening::NamedConstant],
/// and includes any template arguments.
Expand Down Expand Up @@ -54,7 +54,7 @@ pub struct GenerativeParameterKind {
pub struct TypeParameterKind {}

/// See [Parameter]
///
///
/// Must match the [TemplateArgKind] that is passed
#[derive(Debug)]
pub enum ParameterKind {
Expand Down Expand Up @@ -94,7 +94,7 @@ pub struct TemplateArg {
}

/// See [TemplateArg]
///
///
/// The argument kind passed to [ParameterKind], which it must match
#[derive(Debug)]
pub enum TemplateArgKind {
Expand Down Expand Up @@ -135,6 +135,13 @@ impl Display for HowDoWeKnowTheTemplateArg {
}
}

// --------------------------------------------------
// IMPORTANT: To those seeking to refactor this struct: don't.
// It may look like [ConcreteTemplateArg::Value] duplicates [ConcreteType::Value], or that the whole thing could be replaced by [ConcreteType] itself.
// But the [ConcreteTemplateArg::Type] and [ConcreteTemplateArg::Value] cases differentiate often enough, and semantically are more similar to [ParameterKind].
// Attempting to merge these uses with [ConcreteType] internals only leads to confusion.
// --------------------------------------------------

/// Represents the value we're passing into a template argument.
///
/// It is the instantiated variant of [TemplateArg]
Expand Down

0 comments on commit d4f788f

Please sign in to comment.