Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1186173

try/finally gives Internal error in the compiler

XMLWordPrintable

    • sparc
    • generic

      When I compile the following code:

      import oak.io.*;

      class foo {
          static void broken()
          {
      InputStream f = null;
      try {
      f = new FileInputStream("/tmp/junk");
      } finally {
      if (f != null)
      f.close();
      }
          }
      }

      I get the following:

      pan:/tmp[1028] oakc foo.oak
      oak.tools.oak.InternalError selectType: convert
      at oak.lang.Exception.<init>(Exception.oak)
      at oak.tools.oak.InternalError.<init>(InternalError.oak)
      at oak.tools.tree.UnaryExpression.selectType(UnaryExpression.oak)
      at oak.tools.tree.UnaryExpression.checkValue(UnaryExpression.oak)
      at oak.tools.tree.BinaryExpression.checkValue(BinaryExpression.oak)
      at oak.tools.tree.Expression.checkCondition(Expression.oak)
      at oak.tools.tree.Expression.checkCondition(Expression.oak)
      at oak.tools.tree.IfStatement.check(IfStatement.oak)
      at oak.tools.tree.CompoundStatement.check(CompoundStatement.oak)
      at oak.tools.tree.FinallyStatement.check(FinallyStatement.oak)
      oakc: an exception has occurred, please contact x47242.

            ahoffsunw Arthur Hoff (Inactive)
            fyellinsunw Frank Yellin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: