system/src/sc/lang/java/SwitchStatement.java
public Object findMember(String name, EnumSet<MemberType> mtype, Object fromChild, Object refType, TypeContext ctx, boolean skipIfaces) {
      Object v;

      // Resolving the expression should not check for exposed variables in the switch itself
      if (fromChild != expression) {
         if (isEnum && mtype.contains(MemberType.Enum) && isFromSwitchLabel(fromChild)) {
            v = ModelUtil.definesMember(expressionType, name, MemberType.EnumOnlySet, refType, ctx, skipIfaces, false, getLayeredSystem());
            if (v != null)
               return v;
         }

         // Propagate only variable searches
         if (mtype.contains(MemberType.Variable) && statements != null) {
            EnumSet<MemberType> subMtype;
            if (mtype.size() != 1)
               subMtype = EnumSet.of(MemberType.Variable);
            else
               subMtype = mtype;
            for (Statement s:statements)
               if ((v = s.definesMember(name, subMtype, refType, ctx, skipIfaces, false)) != null)
                  return v;
         }
      }
      return super.findMember(name, mtype, this, refType, ctx, skipIfaces);
   }
/**
    * For enum types only if the child is looking up a name, we need to check
    * if the switch expression defines that label.
    *
    * Switch statements also define variables so we need to look them up too.
    */
For enum types only if the child is looking up a name, we need to check
if the switch expression defines that label.

Switch statements also define variables so we need to look them up too.
For enum types only if the child is looking up a name we need to check if the switch expression defines that label . Switch statements also define variables so we need to look them up too .
public Object findMember(String name, EnumSet<MemberType> mtype, Object fromChild, Object refType, TypeContext ctx, boolean skipIfaces) {
      Object v;
      if (fromChild != expression) {
         if (isEnum && mtype.contains(MemberType.Enum) && isFromSwitchLabel(fromChild)) {
            v = ModelUtil.definesMember(expressionType, name, MemberType.EnumOnlySet, refType, ctx, skipIfaces, false, getLayeredSystem());
            if (v != null)
               return v;
         }
         if (mtype.contains(MemberType.Variable) && statements != null) {
            EnumSet<MemberType> subMtype;
            if (mtype.size() != 1)
               subMtype = EnumSet.of(MemberType.Variable);
            else
               subMtype = mtype;
            for (Statement s:statements)
               if ((v = s.definesMember(name, subMtype, refType, ctx, skipIfaces, false)) != null)
                  return v;
         }
      }
      return super.findMember(name, mtype, this, refType, ctx, skipIfaces);
   }
public Object findMember ( String name , EnumSet < MemberType > mtype , Object fromChild , Object refType , TypeContext ctx , boolean skipIfaces ) { Object v ; if ( fromChild != expression ) { if ( isEnum && mtype . contains ( MemberType . Enum ) && isFromSwitchLabel ( fromChild ) ) { v = ModelUtil . definesMember ( expressionType , name , MemberType . EnumOnlySet , refType , ctx , skipIfaces , false , getLayeredSystem ( ) ) ; if ( v != null ) return v ; } if ( mtype . contains ( MemberType . Variable ) && statements != null ) { EnumSet < MemberType > subMtype ; if ( mtype . size ( ) != 1 ) subMtype = EnumSet . of ( MemberType . Variable ) ; else subMtype = mtype ; for ( Statement s : statements ) if ( ( v = s . definesMember ( name , subMtype , refType , ctx , skipIfaces , false ) ) != null ) return v ; } } return super . findMember ( name , mtype , this , refType , ctx , skipIfaces ) ; }
For enum types only if the child is looking up a name, we need to check
 if the switch expression defines that label.
For enum types only if the child is looking up a name we need to check if the switch expression defines that label .
// Resolving the expression should not check for exposed variables in the switch itself // Propagate only variable searches