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

Skip to content

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
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?


// 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, so I must have mixed them up after this point in time.

@som-snytt som-snytt reopened this Nov 5, 2024
@SethTisue SethTisue modified the milestones: 2.13.16, 2.13.17 Dec 12, 2024
@som-snytt
Copy link
Contributor Author

Corner case swept under the rug in the corner.

@som-snytt som-snytt closed this Jun 2, 2025
@lrytz
Copy link
Member

lrytz commented Jun 3, 2025

I enjoyed discovering AntiPolyType.

@SethTisue SethTisue removed this from the 2.13.17 milestone Aug 16, 2025
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