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

fruiteless type test GlobalComplexTypeDef and GlobalGroupDef

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • s10
    • None
    • 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.

      Attachments

        Activity

          People

            jadams_tresys Josh Adams
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: