<commit_before>package org.jetbrains.plugins.scala.lang.resolve;

import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiReference;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScTypeAliasDeclaration;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScTypeAlias;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction;
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition;
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScPattern;
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScReferenceExpression;
import org.jetbrains.plugins.scala.util.TestUtils;

/**
 * @author ven
 */
public class NonlocalResolveTest extends ScalaResolveTestCase{

  protected String getTestDataPath() {
    return TestUtils.getTestDataPath() + "/resolve/";
  }

  public void testTypeDecl() throws Exception {
    PsiReference ref = configureByFile("nonlocal/typedecl.scala");
    assertTrue(ref.resolve() instanceof ScTypeAliasDeclaration);
  }

  public void testSubstitutor1() throws Exception {
    PsiReference ref = configureByFile("nonlocal/substitutor1.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testHigherKind() throws Exception {
    PsiReference ref = configureByFile("nonlocal/higherkind.scala");
    assertTrue(ref.resolve() instanceof ScTypeDefinition);
  }

  public void testCompoundTypes() throws Exception {
    PsiReference ref = configureByFile("nonlocal/compoundtypes.scala");
    assertTrue(ref.resolve() instanceof ScTypeAlias);
  }

  public void testValsAsPatterns() throws Exception {
    PsiReference ref = configureByFile("nonlocal/valsaspatterns.scala");
    assertTrue(ref.resolve() instanceof ScPattern);
  }

  public void testTraitSuperTypes() throws Exception {
    PsiReference ref = configureByFile("nonlocal/traitsupertypes.scala");
    assertTrue(ref.resolve() instanceof ScFunction);
  }

  public void testTypeAliases() throws Exception {
    PsiReference ref = configureByFile("nonlocal/typealiases.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testJavaGenerics() throws Exception {
    PsiReference ref = configureByFile("nonlocal/javaGenerics.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testSubstAliasBound() throws Exception {
    PsiReference ref = configureByFile("nonlocal/substAliasBound.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testRecursiveInvocation() throws Exception {
    PsiReference ref = configureByFile("nonlocal/recursiveInvocation.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testRecursivePattern() throws Exception {
    PsiReference ref = configureByFile("nonlocal/recursivePattern.scala");
    assertNull(ref.resolve());
  }

  public void testBaseClassParam() throws Exception {
    PsiReference ref = configureByFile("nonlocal/baseClassParam.scala");
    assertNotNull(ref.resolve());
  }

  public void testLUB1() throws Exception {
    PsiReference ref = configureByFile("nonlocal/lub1.scala");
    assertNotNull(ref.resolve());
  }
}
class Test {
  protected Test() {
  }
  /* static */ class Test1 extends Test {
    Test1() {
      super();
    }
  }
  static class Test2 extends Test1 {
    Test2() {
      super();
    }
  }
  public static void main(String[] args) {
     new Test2();
  }
}<commit_msg>brrr<commit_after>package org.jetbrains.plugins.scala.lang.resolve;

import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiReference;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScTypeAliasDeclaration;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScTypeAlias;
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction;
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTypeDefinition;
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.ScPattern;
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScReferenceExpression;
import org.jetbrains.plugins.scala.util.TestUtils;

/**
 * @author ven
 */
public class NonlocalResolveTest extends ScalaResolveTestCase{

  protected String getTestDataPath() {
    return TestUtils.getTestDataPath() + "/resolve/";
  }

  public void testTypeDecl() throws Exception {
    PsiReference ref = configureByFile("nonlocal/typedecl.scala");
    assertTrue(ref.resolve() instanceof ScTypeAliasDeclaration);
  }

  public void testSubstitutor1() throws Exception {
    PsiReference ref = configureByFile("nonlocal/substitutor1.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testHigherKind() throws Exception {
    PsiReference ref = configureByFile("nonlocal/higherkind.scala");
    assertTrue(ref.resolve() instanceof ScTypeDefinition);
  }

  public void testCompoundTypes() throws Exception {
    PsiReference ref = configureByFile("nonlocal/compoundtypes.scala");
    assertTrue(ref.resolve() instanceof ScTypeAlias);
  }

  public void testValsAsPatterns() throws Exception {
    PsiReference ref = configureByFile("nonlocal/valsaspatterns.scala");
    assertTrue(ref.resolve() instanceof ScPattern);
  }

  public void testTraitSuperTypes() throws Exception {
    PsiReference ref = configureByFile("nonlocal/traitsupertypes.scala");
    assertTrue(ref.resolve() instanceof ScFunction);
  }

  public void testTypeAliases() throws Exception {
    PsiReference ref = configureByFile("nonlocal/typealiases.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testJavaGenerics() throws Exception {
    PsiReference ref = configureByFile("nonlocal/javaGenerics.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testSubstAliasBound() throws Exception {
    PsiReference ref = configureByFile("nonlocal/substAliasBound.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testRecursiveInvocation() throws Exception {
    PsiReference ref = configureByFile("nonlocal/recursiveInvocation.scala");
    assertTrue(ref.resolve() instanceof PsiMethod);
  }

  public void testRecursivePattern() throws Exception {
    PsiReference ref = configureByFile("nonlocal/recursivePattern.scala");
    assertNull(ref.resolve());
  }

  public void testBaseClassParam() throws Exception {
    PsiReference ref = configureByFile("nonlocal/baseClassParam.scala");
    assertNotNull(ref.resolve());
  }

  public void testLUB1() throws Exception {
    PsiReference ref = configureByFile("nonlocal/lub1.scala");
    assertNotNull(ref.resolve());
  }
}
{'fraction_non_alphanumeric': 0.10736522399392559, 'fraction_numerical': 0.002126044039483675, 'mean_word_length': 4.949412827461608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5218692', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1857, 'n_words': 365}