<commit_before>/*
 * Copyright 2001-2014 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest.matchers

import scala.reflect.macros.Context
import org.scalatest.words.{ResultOfAnTypeInvocation, MatcherWords, ResultOfATypeInvocation}
import org.scalatest.{UnquotedString, Resources, Suite, FailureMessages, Assertions}
import org.scalactic.Prettifier

private[scalatest] object TypeMatcherMacro {

  def checkNoTypeParameter(context: Context)(tree: context.Tree, methodName: String) {

    import context.universe._

    def containsTypeParameter(typeList: List[TypeTree]): Boolean =
      typeList.exists { t =>
        t.original match {
          case AppliedTypeTree(_, _) => true
          case _ => false
        }
      }

    tree match {
      case Apply(
             TypeApply(
               Select(
                 _,
                 methodNameTermName
               ),
               typeList: List[TypeTree]
             ),
             _
           ) if methodNameTermName.decoded == methodName && containsTypeParameter(typeList) =>
        context.warning(context.macroApplication.pos, "Type parameter should not be specified because it will be erased at runtime, please use _ instead.  Note that in future version of ScalaTest this will give a compiler error.")

      case _ =>
    }
<commit_msg>Adjusted arrow position of warning message given by TypeMatcherMacro.<commit_after>/*
 * Copyright 2001-2014 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest.matchers

import scala.reflect.macros.Context
import org.scalatest.words.{ResultOfAnTypeInvocation, MatcherWords, ResultOfATypeInvocation}
import org.scalatest.{UnquotedString, Resources, Suite, FailureMessages, Assertions}
import org.scalactic.Prettifier

private[scalatest] object TypeMatcherMacro {

  def checkNoTypeParameter(context: Context)(tree: context.Tree, methodName: String) {

    import context.universe._

    tree match {
      case Apply(
             TypeApply(
               Select(
                 _,
                 methodNameTermName
               ),
               typeList: List[TypeTree]
             ),
             _
           ) if methodNameTermName.decoded == methodName =>
        typeList.foreach { t =>
          t.original match {
            case AppliedTypeTree(tpt, args) =>
              context.warning(args(0).pos, "Type parameter should not be specified because it will be erased at runtime, please use _ instead.  Note that in future version of ScalaTest this will give a compiler error.")

            case _ =>
          }
        }

      case _ =>
    }

{'fraction_non_alphanumeric': 0.07489106753812637, 'fraction_numerical': 0.006808278867102397, 'mean_word_length': 2.7251521298174444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5146970', 'n_tokens_mistral': 963, 'n_tokens_neox': 926, 'n_words': 336}