Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow using clauses to introduce Scala-2 conversions#13662

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
odersky merged 1 commit intoscala:masterfromdotty-staging:fix-12955
Oct 4, 2021

Conversation

@odersky
Copy link
Contributor

Notably,(using A <:< B) should introduce an implicit conversion.
Previously that did not work since we tried to elaborate the context
parameter as ascala.Conversion.

Notably, `(using A <:< B)` should introduce an implicit conversion.Previously that did not work since we tried to elaborate the contextparameter as a `scala.Conversion`.
Copy link
Member

@dwijnanddwijnand left a comment

Choose a reason for hiding this comment

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

Unless I'm blind, this makes(using map: Map[String, Int]) a problem again. I think we should "just" special-case<:< (and thus its subclass=:=): I know it's a special-casing, but I see it as a retroactive definition of them as subclasses ofConversion. Perhaps it can even be special-cased that way: stickConversion as<:<'s base class or interfaces?

@odersky
Copy link
ContributorAuthor

@dwijnand

Unless I'm blind, this makes (using map: Map[String, Int]) a problem again.

No, we do require that the implicit candidate returns aConversion for that test, whichMap does not do. There are actually two code points that are relevant here. One is infilterMatching where we do indeed special case<:<. The problem was that<:< can still only be used when passed as animplicit. And that's what is fixed by this PR.

Copy link
Member

@dwijnanddwijnand left a comment

Choose a reason for hiding this comment

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

Ah, right. Thanks! Do we have or want to add a test to safe guard against that Map puzzler?

@odersky
Copy link
ContributorAuthor

odersky commentedOct 4, 2021 via email

I think we do have a test. But I have not looked it up.
On Mon, Oct 4, 2021 at 10:08 AM Dale Wijnand ***@***.***> wrote: ***@***.**** approved this pull request. Ah, right. Thanks! Do we have or want to add a test to safe guard against that Map puzzler? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#13662 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGCKVVJFUPPUERXSO7WDJTUFFOGJANCNFSM5FHMAJYA> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
-- Martin OderskyProfessor, Programming Methods Group (LAMP)Faculty IC, EPFLStation 14, Lausanne, Switzerland

@oderskyodersky merged commitd4ba729 intoscala:masterOct 4, 2021
@oderskyodersky deleted the fix-12955 branchOctober 4, 2021 10:38
@KordyjanKordyjan added this to the3.1.1 milestoneAug 2, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dwijnanddwijnanddwijnand approved these changes

@nicolasstuckinicolasstuckiAwaiting requested review from nicolasstucki

Assignees

@nicolasstuckinicolasstucki

Labels

None yet

Projects

None yet

Milestone

3.1.1

Development

Successfully merging this pull request may close these issues.

Scala 3 does not perform implicit conversion using <:<

4 participants

@odersky@dwijnand@nicolasstucki@Kordyjan

[8]ページ先頭

©2009-2025 Movatter.jp