<commit_before><commit_msg>Add failing test case for local classes inside async blocks<commit_after>package scala.async
package run
package await0

/**
 * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com>
 */

import language.{reflectiveCalls, postfixOps}

import scala.concurrent.{Future, ExecutionContext, future, Await}
import scala.concurrent.duration._
import scala.async.Async.{async, await}
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Test

class LocalClasses0Class {

  import ExecutionContext.Implicits.global
  
  def base(x: Int): Future[Int] = future {
    x + 2
  }
  
  def methodWithLocalClass(): Future[Int] = async {
    case class Person(name: String)
    val fut = base(10)
    val x = await(fut)
    x + 1
  }
}

@RunWith(classOf[JUnit4])
class LocalClasses0Spec {

  @Test
  def `An async method should reject local classes without crashing`() {
    val o = new LocalClasses0Class
    val fut = o.methodWithLocalClass()
    val res = Await.result(fut, 2 seconds)
    res mustBe (13)
  }
}

{'fraction_non_alphanumeric': 0.10321969696969698, 'fraction_numerical': 0.016098484848484848, 'mean_word_length': 3.916279069767442, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5629873', 'n_tokens_mistral': 358, 'n_tokens_neox': 343, 'n_words': 96}