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

Under-Xsource:3, adjust 2.13.9 change to ignore override type for whitebox macro expansion#10188

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:issue/12647-more-whitebox
Oct 26, 2022

Conversation

@som-snytt
Copy link
Contributor

@som-snyttsom-snytt commentedOct 13, 2022
edited by SethTisue
Loading

Improve the condition for inferring the type of an overriding def under-Xsource:3: use the precise type of the RHS if the RHS is the expansion of a whitebox macro.

Adjusts#9891
Fixesscala/bug#12647

He-Pin and sideeffffect reacted with heart emoji
@scala-jenkinsscala-jenkins added this to the2.13.11 milestoneOct 13, 2022
@som-snytt
Copy link
ContributorAuthor

Probably theopenMacros check can be removed.

//t.tpe.typeSymbol.isAnonOrRefinementClass && also note it doesn't matter what the narrower type is, but this is the use case.

@som-snyttsom-snytt requested a review fromlrytzOctober 13, 2022 17:51
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.

LGTM otherwise, thank you! This fix makes sense 👍

privatedefassignTypeToTree(tree:ValOrDefDef,defnTyper:Typer,pt:Type):Type= {
valrhsTpe= treematch {
caseddef:DefDefif tree.symbol.isTermMacro=> defnTyper.computeMacroDefType(ddef, pt)
caseddef:DefDefif tree.symbol.isTermMacro=> defnTyper.computeMacroDefType(ddef, pt)// unreached, see methodSig
Copy link
Member

Choose a reason for hiding this comment

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

So this can be removed?

There's also a comment incomputeMacroDefType saying

if a macro def doesn't have explicitly specified return type, this method will be called again byassignTypeToTree

is that stale?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I was reluctant to expand the scope, as macros remain experimental.

@SethTisueSethTisue added the release-notesworth highlighting in next release notes labelOct 19, 2022
@SethTisue
Copy link
Member

@lrytz want to press "merge", here?

lrytz reacted with thumbs up emoji

@lrytzlrytz merged commit8fa1e7c intoscala:2.13.xOct 26, 2022
@SethTisueSethTisue changed the titleIgnore override type just for whitebox expansionUnder-Xsource:3, adjust 2.13.10 change to ignore override type for whitebox macro expansionOct 26, 2022
@SethTisueSethTisue changed the titleUnder-Xsource:3, adjust 2.13.10 change to ignore override type for whitebox macro expansionUnder-Xsource:3, adjust 2.13.9 change to ignore override type for whitebox macro expansionOct 26, 2022
@som-snyttsom-snytt deleted the issue/12647-more-whitebox branchOctober 26, 2022 15:10
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.

[2.13.9, 2.13.10] Issue with zio-prelude1.0.0-RC8-1 (zio1) macros

4 participants

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

[8]ページ先頭

©2009-2025 Movatter.jp