Scala Programming Language
  1. Scala Programming Language
  2. SI-2388

Peculiar error message "not found: type $$anon"

    Details

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

      Description

      [Edited/minimized.] The spurious $anon error does not occur if they are both defs.

      class Foo {
        val searchField = new AnyRef { search() }
        def search() = searchField
      }
      

        Issue Links

          Activity

          Hide
          Antonio Cunei added a comment -

          Still present as of r18812.

          Show
          Antonio Cunei added a comment - Still present as of r18812.
          Hide
          Paul Phillips added a comment -

          I'm kicking this back to reviewer because I'm not able to figure what puts it in my zone. BTW these days there is only one spurious error:

          scalac28 MyDialog2.scala 
          MyDialog2.scala:12: error: recursive method search needs result type
                  search()
                  ^
          MyDialog2.scala:9: error: not found: type $$anon
            private val searchField = new JTextField() {
                                      ^
          two errors found
          
          Show
          Paul Phillips added a comment - I'm kicking this back to reviewer because I'm not able to figure what puts it in my zone. BTW these days there is only one spurious error: scalac28 MyDialog2.scala MyDialog2.scala:12: error: recursive method search needs result type search() ^ MyDialog2.scala:9: error: not found: type $$anon private val searchField = new JTextField() { ^ two errors found
          Hide
          Aleksandar Prokopec added a comment -

          Martin, could you take a look at this? We concluded at the meeting that this might be a type inference issue.

          Show
          Aleksandar Prokopec added a comment - Martin, could you take a look at this? We concluded at the meeting that this might be a type inference issue.
          Hide
          Commit Message Bot added a comment -

          (extempore in r25457) Avoid some spurious errors after a cyclical reference error.
          Closes SI-2388, no review.

          Show
          Commit Message Bot added a comment - (extempore in r25457 ) Avoid some spurious errors after a cyclical reference error. Closes SI-2388 , no review.

            People

            • Assignee:
              Paul Phillips
              Reporter:
              Olli Aalto
              TracCC:
              Paul Phillips
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development