anchor.diff:      // Step 2: Search use-lines.
       final resourceId = declarationId.resourceId;
       final simpleType = type.simpleTypes.first.name;
  -    final importedModules = findModuleInUseLines(
  +    final importedModuleResult = findModuleInUseLines(
         context,
         Tuple4(resourceId, simpleType.name, simpleType.span, false),
       );
  -    if (importedModules is None) {
  +    if (importedModuleResult is None) {
         throw CompilerError.typeNotFound(
           'Type `${simpleType.name}` could not be resolved.',
           location: ErrorLocation(resourceId, type.simpleTypes.first.span),
         );
       }
  -
  -    final resultDeclarationId =
  -        moduleIdToDeclarationId(context, importedModules.value);
  +    final importedModule = importedModuleResult.value;
  +    final moduleId = importedModule
  +        .nested(type.simpleTypes.skip(1).map((it) => it.name.name).toList());
  +
  +    final resultDeclarationId = moduleIdToDeclarationId(context, moduleId);
       if (resultDeclarationId.isModule) {
         throw CompilerError.typeNotFound(
           'Type `${simpleType.name}` could not be resolved.',
  
positive.code:     }
      assert(resultDeclarationId.isTrait || resultDeclarationId.isClass);
      return hir.CandyType.user(
        importedModules.value.parent,
        resultDeclarationId.simplePath.last.nameOrNull,
      );
    },
  
negative.code:     final declarationId = inputs.first;
      final type = inputs.second;
  
      // Step 1: Look for traits/classes in outer modules in the same file.
      final localResult = _resolveAstUserTypeInFile(context, declarationId, type);
      if (localResult.isSome) return localResult.value;
  