can't use var with a class named Z

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 11
    • Component/s: tools
    • None
    • b06

      jshell> class Z {}
      | created class Z

      jshell> var myVariable = new Z()
      | Error:
      | unexpected type
      | required: class
      | found: type parameter Z
      | var myVariable = new Z();
      | ^

      Apparently there's some internal construct that leaks the type variable Z into the user's namespace.

      https://stackoverflow.com/questions/62102369/jshell-error-unexpected-type-when-using-specific-class-name

            Assignee:
            Jan Lahoda
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: