package jetbrains.mps.baseLanguage.typesystem; /*Generated by MPS */ import jetbrains.mps.lang.typesystem.runtime.ComparisonRule_Runtime; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.typesystem.runtime.IsApplicable2Status; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.typesystem.inference.TypeChecker; import jetbrains.mps.lang.typesystem.runtime.IsApplicableStatus; import org.jetbrains.mps.openapi.language.SAbstractConcept; public class TypeVariableReference_compatibleWith_otherType_ComparisonRule extends ComparisonRule_Runtime { public TypeVariableReference_compatibleWith_otherType_ComparisonRule() { } public boolean areComparable(SNode node1, SNode node2, IsApplicable2Status status) { SNode bound = SLinkOperations.getTarget(SLinkOperations.getTarget(node1, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102467229d8L, 0x1024673a581L, "typeVariableDeclaration")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x1024639ed74L, 0x11ae375bda0L, "bound")); if ((bound == null)) { return true; } { SNode matchedNode_p68yon_c0 = node2; { boolean matches_p68yon_a2a = false; { SNode matchingNode_p68yon_a2a = node2; if (matchingNode_p68yon_a2a != null) { matches_p68yon_a2a = matchingNode_p68yon_a2a.getConcept().isSubConceptOf(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102467229d8L, "jetbrains.mps.baseLanguage.structure.TypeVariableReference")); } } if (matches_p68yon_a2a) { { SNode otherbound = SLinkOperations.getTarget(SLinkOperations.getTarget(matchedNode_p68yon_c0, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102467229d8L, 0x1024673a581L, "typeVariableDeclaration")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x1024639ed74L, 0x11ae375bda0L, "bound")); if ((otherbound == null)) { return true; } return TypeChecker.getInstance().getSubtypingManager().isSubtype(bound, otherbound) || TypeChecker.getInstance().getSubtypingManager().isSubtype(otherbound, bound); } } else return TypeChecker.getInstance().getSubtypingManager().isSubtype(bound, node2) || TypeChecker.getInstance().getSubtypingManager().isSubtype(node2, bound); } } } public boolean isWeak() { return true; } public IsApplicableStatus isApplicableFirst(SNode node) { return new IsApplicableStatus(node.getConcept().isSubConceptOf(getApplicableConcept1()), null); } public IsApplicableStatus isApplicableSecond(SNode node) { return new IsApplicableStatus(node.getConcept().isSubConceptOf(getApplicableConcept2()), null); } public SAbstractConcept getApplicableConcept1() { return MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x102467229d8L, "jetbrains.mps.baseLanguage.structure.TypeVariableReference"); } public SAbstractConcept getApplicableConcept2() { return MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL, "jetbrains.mps.baseLanguage.structure.Type"); } }