Skip to content
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

chore: align @implicitNotFound and @implicitAmbigous with the spec #22371

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

hamzaremmal
Copy link
Member

@hamzaremmal hamzaremmal commented Jan 15, 2025

Closes #22367
Closes #22346

@@ -1420,6 +1420,10 @@ trait Checking {
case Literal(_) => // ok
case _ =>
report.error(em"@${cls.name} needs a string literal as argument", arg.srcPos)
case Apply(tycon, arg :: Nil) if cls == defn.ImplicitNotFoundAnnot || cls == defn.ImplicitAmbiguousAnnot =>
arg.tpe.widenTermRefExpr.normalized match
Copy link
Member Author

Choose a reason for hiding this comment

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

This check was borrowed from:

for (case ConstantType(c) <- argument(i) map (_.tpe.widenTermRefExpr.normalized)) yield c

@hamzaremmal hamzaremmal enabled auto-merge January 15, 2025 10:59
@hamzaremmal hamzaremmal merged commit 1270d13 into scala:main Jan 15, 2025
29 checks passed
@hamzaremmal hamzaremmal deleted the i22367 branch January 15, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants