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

Do not fold IsConst applied to dependent parameters #15759

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented Jul 26, 2022

IsConst is currently folded too early when applied to dependent parameters, before they have a chance to be substituted. Here is an example of the problem:

val x: 2 = 2

summon[IsConst[x.type] =:= true] // works

def isConst(arg: Int)(using IsConst[arg.type] =:= true): Unit = ???
isConst(x) // error; IsConst[(arg: Int)] =:= false

This PR fixes this issue, so that the second case also works.

@mbovel mbovel force-pushed the mb/isConst-lazy branch from 0ee9b4e to 2cd48eb Compare July 26, 2022 15:03
@mbovel mbovel requested a review from odersky July 26, 2022 15:03
@mbovel mbovel force-pushed the mb/isConst-lazy branch from 2cd48eb to b100ecc Compare July 26, 2022 15:09
@mbovel mbovel force-pushed the mb/isConst-lazy branch from b100ecc to b1e723c Compare July 26, 2022 15:10
@Kordyjan Kordyjan mentioned this pull request Jul 26, 2022
23 tasks
@Kordyjan Kordyjan merged commit 8e17110 into scala:main Jul 27, 2022
@Kordyjan Kordyjan deleted the mb/isConst-lazy branch July 27, 2022 08:21
@mbovel
Copy link
Member Author

mbovel commented Jul 27, 2022

Why did you merge this PR @Kordyjan? It might have ended it the list of back-ported PRs by mistake.

I think it's ok to have it merged, but it would still be nice if someone could review it.

@Kordyjan Kordyjan restored the mb/isConst-lazy branch July 27, 2022 13:48
@Kordyjan
Copy link
Contributor

Kordyjan commented Jul 27, 2022

That is something peculiar. I have no clue why this PR landed on the backports list. I'll try to get to know what happened. I also need to check if that means some legit backport for 3.2 was not merged.

I'm sorry for the situation.

@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 2023
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.

2 participants