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,15 +774,21 @@ 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) => { | ||||||
|                 .scope |                 if custom_type_key.1 == state.module_id.unwrap() { | ||||||
|                 .types |                     state | ||||||
|                 .get(custom_type_key) |                         .scope | ||||||
|                 .map(|_| ()) |                         .types | ||||||
|                 .ok_or(ErrorKind::NoSuchType( |                         .get(custom_type_key) | ||||||
|                     custom_type_key.0.clone(), |                         .map(|_| ()) | ||||||
|                     state.module_id.unwrap(), |                         .ok_or(ErrorKind::NoSuchType( | ||||||
|                 )), |                             custom_type_key.0.clone(), | ||||||
|  |                             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