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

Deprecate infix type args, as they are dropped in Scala 3#10255

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
lrytz merged 1 commit intoscala:2.13.xfromsom-snytt:deprecate/infix-type-arg
Jan 6, 2023

Conversation

@som-snytt
Copy link
Contributor

@som-snyttsom-snytt commentedJan 5, 2023
edited
Loading

Type arguments for infix expressions were added but never included in the specification and never received any support in Scala 3. They are now deprecated in Scala 2 and error under-Xsource:3.

For example, the 4th expression below is deprecated. In general, Scala 3 encourages only symbolic operators as infix operators, and never allows type arguments.

scala> xs.map(_ + 1)val res1: List[Int] = List(43)scala> xs map (_ + 1)val res2: List[Int] = List(43)scala> xs.map[Int](_ + 1)val res3: List[Int] = List(43)scala> xs map[Int] (_ + 1)val res4: List[Int] = List(43)

@som-snyttsom-snyttforce-pushed thedeprecate/infix-type-arg branch from8ef8560 to88afd4aCompareJanuary 6, 2023 03:53
@som-snyttsom-snytt marked this pull request as ready for reviewJanuary 6, 2023 03:53
@scala-jenkinsscala-jenkins added this to the2.13.11 milestoneJan 6, 2023
Copy link
Member

@lrytzlrytz left a comment

Choose a reason for hiding this comment

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

👍 thank you!

@lrytzlrytzenabled auto-mergeJanuary 6, 2023 11:00
@lrytzlrytz merged commit83908d9 intoscala:2.13.xJan 6, 2023
@SethTisueSethTisue changed the titleInfix type args dropped in Scala 3Deprecate infix type args, as they are dropped in Scala 3Jan 6, 2023
@SethTisueSethTisue added the release-notesworth highlighting in next release notes labelJan 6, 2023
@SethTisue
Copy link
Member

The mailing list discussion linked from the original PR

link?

@som-snytt
Copy link
ContributorAuthor

a1c00ae

The commit message also shows the infix expression in the style of the era.

Today, infix prefers operators, especially for leading infix syntax (which requires backquoted alnum identifiers).

@som-snyttsom-snytt deleted the deprecate/infix-type-arg branchJanuary 6, 2023 18:17
@SethTisue
Copy link
Member

SethTisue commentedJan 8, 2023
edited
Loading

@som-snytt would you mind updating the PR description to tell readers, who might be fairly casual users of Scala and haven't followed this stuff, what the change is, in a self-contained way? with an example of what "infix type args" even are?

ches reacted with heart emoji

@som-snytt
Copy link
ContributorAuthor

preserving the OP

Under -Xsource:3, error.

The feature was adopted during the dotless craze of 2013, but never taken up by dotty for obvious reasons (naming).

The mailing list discussion linked from the original PR shows only partial consensus.

SethTisue reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lrytzlrytzlrytz approved these changes

Assignees

No one assigned

Labels

release-notesworth highlighting in next release notes

Projects

None yet

Milestone

2.13.11

Development

Successfully merging this pull request may close these issues.

4 participants

@som-snytt@SethTisue@lrytz@scala-jenkins

[8]ページ先頭

©2009-2025 Movatter.jp