Only test for typedefinitions in current module
This commit is contained in:
parent
b723ff2d06
commit
82758ae333
@ -32,7 +32,7 @@ impl Display for Context {
|
|||||||
|
|
||||||
impl Display for Module {
|
impl Display for Module {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
writeln!(f, "Module({}) {{", self.name)?;
|
writeln!(f, "Module({}) ({}) {{", self.name, self.module_id)?;
|
||||||
|
|
||||||
let mut state = Default::default();
|
let mut state = Default::default();
|
||||||
let mut inner_f = PadAdapter::wrap(f, &mut state);
|
let mut inner_f = PadAdapter::wrap(f, &mut state);
|
||||||
|
@ -774,7 +774,9 @@ impl TypeKind {
|
|||||||
fn is_known(&self, refs: &TypeRefs, state: &TypecheckPassState) -> Result<(), ErrorKind> {
|
fn is_known(&self, refs: &TypeRefs, state: &TypecheckPassState) -> Result<(), ErrorKind> {
|
||||||
match &self {
|
match &self {
|
||||||
TypeKind::Array(type_kind, _) => type_kind.as_ref().is_known(refs, state),
|
TypeKind::Array(type_kind, _) => type_kind.as_ref().is_known(refs, state),
|
||||||
TypeKind::CustomType(custom_type_key) => state
|
TypeKind::CustomType(custom_type_key) => {
|
||||||
|
if custom_type_key.1 == state.module_id.unwrap() {
|
||||||
|
state
|
||||||
.scope
|
.scope
|
||||||
.types
|
.types
|
||||||
.get(custom_type_key)
|
.get(custom_type_key)
|
||||||
@ -782,7 +784,11 @@ impl TypeKind {
|
|||||||
.ok_or(ErrorKind::NoSuchType(
|
.ok_or(ErrorKind::NoSuchType(
|
||||||
custom_type_key.0.clone(),
|
custom_type_key.0.clone(),
|
||||||
state.module_id.unwrap(),
|
state.module_id.unwrap(),
|
||||||
)),
|
))
|
||||||
|
} else {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
TypeKind::Borrow(type_kind, _) => type_kind.is_known(refs, state),
|
TypeKind::Borrow(type_kind, _) => type_kind.is_known(refs, state),
|
||||||
TypeKind::UserPtr(type_kind) => type_kind.is_known(refs, state),
|
TypeKind::UserPtr(type_kind) => type_kind.is_known(refs, state),
|
||||||
TypeKind::CodegenPtr(type_kind) => type_kind.is_known(refs, state),
|
TypeKind::CodegenPtr(type_kind) => type_kind.is_known(refs, state),
|
||||||
|
Loading…
Reference in New Issue
Block a user