From 88964f503e01fc9fed690bb826015f10e60a509d Mon Sep 17 00:00:00 2001 From: paulklint Date: Mon, 4 Nov 2024 00:12:11 +0100 Subject: [PATCH] Reenabled isCompatibleBinaryLibrary --- .../library/lang/rascalcore/check/Import.rsc | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc index 61e171f0..4ef58c33 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc @@ -201,27 +201,26 @@ str getModuleFromLogical(loc l){ // Is what library module lib provides compatible with all uses in the modules libUsers? tuple[bool, ModuleStatus] isCompatibleBinaryLibrary(TModel lib, set[str] libUsers, ModuleStatus ms){ - return ; - - // libName = lib.modelName; - // libProvides = domain(lib.logical2physical); - // libProvidesModules = { getModuleFromLogical(l) | l <- libProvides }; - // usersRequire = {}; - // for(m <- libUsers){ - // = getTModelForModule(m, ms); - // if(found){ - // usersRequire += domain(tm.logical2physical); - // } - // } - // usersRequireFromLib = { l | l <- usersRequire, getModuleFromLogical(l) in libProvidesModules }; - - // if(usersRequireFromLib <= libProvides){ - // println("isCompatibleBinaryLibrary : satisfied"); - // return ; - // } else { - // println("isCompatibleBinaryLibrary, unsatisfied: "); - // return ; - // } + + libName = lib.modelName; + libProvides = domain(lib.logical2physical); + libProvidesModules = { getModuleFromLogical(l) | l <- libProvides }; + usersRequire = {}; + for(m <- libUsers){ + = getTModelForModule(m, ms); + if(found){ + usersRequire += domain(tm.logical2physical); + } + } + usersRequireFromLib = { l | l <- usersRequire, getModuleFromLogical(l) in libProvidesModules }; + + if(usersRequireFromLib <= libProvides){ + println("isCompatibleBinaryLibrary : satisfied"); + return ; + } else { + println("isCompatibleBinaryLibrary, unsatisfied: "); + return ; + } } tuple[bool, ModuleStatus] importsAndExtendsAreBinaryCompatible(TModel tm, set[str] importsAndExtends, ModuleStatus ms){