Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Handle AntiPolyType in Symbol.alternatives #10832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

@scala-jenkins scala-jenkins added this to the 2.13.16 milestone Aug 12, 2024
cannot be applied to (Int)
def f = A.a[Int][String](0)
^
1 error
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not attempt to compete with dotty.

8 |  def f  = A.a[Int][String](0)
  |           ^^^
  |           None of the overloaded alternatives of method a in object A with types
  |            [F](x: String): Int
  |            [F](x: Int): Int
  |           match type arguments [Int] and type arguments [String] and arguments ((0 : Int))
  |
  |           where:    F is a type variable

@som-snytt som-snytt force-pushed the issue/10628-overload+type-apps branch from 26ff2ce to 175256b Compare August 13, 2024 22:43
@@ -4162,6 +4161,8 @@ trait Types
case TypeRef(pre, sym, Nil) => copyTypeRef(tycon, pre, sym, args)
case TypeRef(pre, sym, bogons) => devWarning(s"Dropping $bogons from $tycon in appliedType.") ; copyTypeRef(tycon, pre, sym, args)
case PolyType(tparams, restpe) => restpe.instantiateTypeParams(tparams, args)
case MethodType(params, resultType) => resultType
case NullaryMethodType(resultType) => resultType
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this happen with erroneous trees? Could you add a comment, maybe a devWarning like above?

@@ -2936,8 +2936,7 @@ trait Types

object MethodType extends MethodTypeExtractor

// TODO: rename so it's more appropriate for the type that is for a method without argument lists
// ("nullary" erroneously implies it has an argument list with zero arguments, it actually has zero argument lists)
// Nullary not nilary, i.e., parameterlistless not merely parameterless
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah this is where I fixed the comment

@som-snytt som-snytt reopened this Nov 5, 2024
@SethTisue SethTisue modified the milestones: 2.13.16, 2.13.17 Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple type applications on overloaded method crashes scalac
4 participants