title: IntelliJ breakpoint in scala foreach not working
body: <p>I'm using IntelliJ IDEA Ultimate 16.1.2 and Scala 12. When setting breakpoints in foreach loops, they don't get hit. </p>
  
  <p>Breakpoints above the foreach work and get the tick in the breakpoint (valid breakpoint) but the ones in the foreach don't get the tick and the program doesn't break there either. </p>
  
  <p>I tried invalidating the IntelliJ Cash, restarting my PC and IntelliJ, rebuilding maven - nothing worked.</p>
  
  <p>This are the VM parameters I'm using, but I've also tried it without any, which didn't help:</p>
  
  <pre><code>-XX:+UnlockCommercialFeatures
  -XX:+FlightRecorder
  -Dcom.sun.management.jmxremote
  -XX:StartFlightRecording=filename=recording.jfr
  -server
  -Xms1G
  -Xmx4G
  -XX:+UseG1GC
  -XX:+UseStringDeduplication 
  </code></pre>
  
  <p>Thanks for your help!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>class RunTestCasesAction extends AbstractAction {
  
    def actionPerformed(e: ActionEvent) = {
        val parent = methodToGetParentComponent() //breakpoint works
        getFileName(parent).foreach { testFileName =&gt; 
          val dialog = new SomeDialog() // breakpoint doesn't work    
        }
    }
  
    private def getFileName(parent: Component): Option[String] = {
      val baseDir = getExportDir
      val fc = new JFileChooser(baseDir)
      val rc = fc.showDialog(null, "Select test file")
  
      if (rc == JFileChooser.APPROVE_OPTION) Some(fc.getSelectedFile.toString) else None
    }
  </code></pre>