INITIAL GENERICS IMPL

This commit is contained in:
2025-04-15 03:21:57 -04:00
parent 993458f4be
commit 329b1d86ac
18 changed files with 607 additions and 381 deletions

View File

@@ -3,9 +3,12 @@ use crate::common::{CompilerMsg, CompilerOutput, FileSpan};
use super::{Type, UProgram};
impl CompilerOutput {
pub fn check_assign(&mut self, p: &UProgram, src: &Type, dest: &Type, span: FileSpan) -> bool {
pub fn check_assign(&mut self, p: &UProgram, src: &Type, dest: &Type, span: FileSpan) {
// TODO: spans
if src != dest {
if !src.is_real() || !dest.is_real() {
return;
}
self.err(CompilerMsg {
msg: format!(
"Cannot assign type '{}' to '{}'",
@@ -14,9 +17,6 @@ impl CompilerOutput {
),
spans: vec![span],
});
true
} else {
false
}
}
}