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

Warning for trivial infinite looping method definition

    Details

      Description

      This happens to me with embarrassing regularity:

      trait A { def a: Int }
      def foo(a: Int) {
        new A {
          def a = a
        }
      }
      

      A warning would be lovely. If could be cleared with def a = this.a in case someone really wants to use this construct to contribute to global warming.

        Activity

        Hide
        Jason Zaugg added a comment -

        https://github.com/scala/scala/pull/1275

        There is no way to clear the warning, but I don't see why anyone would want to do that.

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1275 There is no way to clear the warning, but I don't see why anyone would want to do that.

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Jason Zaugg
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development