Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-700

fruiteless type test GlobalComplexTypeDef and GlobalGroupDef

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: s10
    • Component/s: None
    • Labels:
      None

      Description

      Going down a rabbit hole, I started seeing how difficult it would be to upgrade to scala 2.10. Not too bad, but it found some warnings:

      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:256: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalComplexTypeDef
      [warn]           case gct: GlobalComplexTypeDef => gct.element.nearestEnclosingSequence
      [warn]                     ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:257: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalGroupDef
      [warn]           case gd: GlobalGroupDef => gd.groupRef.nearestEnclosingSequence
      [warn]                    ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:284: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalComplexTypeDef
      [warn]           case gct: GlobalComplexTypeDef => gct.element.inChoiceBeforeNearestEnclosingSequence
      [warn]                     ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:285: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalGroupDef
      [warn]           case gd: GlobalGroupDef => gd.groupRef.inChoiceBeforeNearestEnclosingSequence
      [warn]                    ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:178: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalComplexTypeDef
      [warn]           case gct: GlobalComplexTypeDef => gct.element.allTerminatingMarkup
      [warn]                     ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:179: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalGroupDef
      [warn]           case gd: GlobalGroupDef => gd.groupRef.allTerminatingMarkup
      [warn]                    ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:310: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalComplexTypeDef
      [warn]           case gct: GlobalComplexTypeDef => gct.element.immediatelyEnclosingModelGroup
      [warn]                     ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:311: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.Term cannot also be a edu.illinois.ncsa.daffodil.dsom.GlobalGroupDef
      [warn]           case gd: GlobalGroupDef => gd.groupRef.immediatelyEnclosingModelGroup
      [warn]                    ^
      [warn] /home/slawrence/tresys/daffodil/daffodil.git/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/Groups.scala:426: fruitless type test: a value of type edu.illinois.ncsa.daffodil.dsom.ModelGroup cannot also be a edu.illinois.ncsa.daffodil.dsom.GroupRef
      [warn]       case (g: GroupRef) => Some(g)

      Basically, the code is doing this match with some of the cases being GlobalComplexTypeDef and GlobalGroupDef, which don't appear to inherit from Term (which is what this is).

      Also, note that the last line of the above output is a fruitless match of GroupRef/ModelGroup.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              jadams Joshua Adams
              Reporter:
              slawrence Steve Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Tasks