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

Don't explain erroneous bounds #19338

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

som-snytt
Copy link
Contributor

Fixes #19334

case skolem: SkolemType => true
case sym: Symbol =>
case skolem: SkolemType => true
case sym: Symbol =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
case sym: Symbol =>
case sym: Symbol =>

There is nothing on the right of => to align.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I go back & forth on this style. The question is, in mix of one-liners, is the odd arrow also aligned?

Also default case: case _ => ??? where it's always ugly to align.

I'm not a huge fan of formatters, but for this use case, it would restore my decision budget.


@main def main = foo:
def f() = ()
f(_) // error was OOM formatting TypeVar(TypeParamRef(T)) when offering explanations
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be worth adding a tests/neg/i19334.check file for this one.

Copy link
Contributor Author

@som-snytt som-snytt Jan 3, 2024

Choose a reason for hiding this comment

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

footnote I had one locally. I'm unaccustomed to the dotty-local customs around check files.

shell history

touch  tests/neg/i19334.check
git add tests/neg/i19334.*
git rm tests/neg/i19334.check

I need shell history with comments, to tell me why I decided to do that.

case skolem: SkolemType => true
case sym: Symbol =>
case skolem: SkolemType => true
case sym: Symbol =>
ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds.empty
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This equality check looks like the previous tweak to use =:= for this comparison. I have not yet investigated / learned about it.

@nicolasstucki
Copy link
Contributor

@som-snytt could you squash the commits before we merge?

@som-snytt
Copy link
Contributor Author

Thanks, squashed.

@som-snytt som-snytt merged commit 708e640 into scala:main Jan 6, 2024
19 checks passed
@som-snytt som-snytt deleted the issue/19334-OOM-erroring branch January 6, 2024 16:54
@Kordyjan Kordyjan added this to the 3.4.1 milestone Feb 14, 2024
WojciechMazur added a commit that referenced this pull request Jun 28, 2024
Backports #19338 to the LTS branch.
Fixes #20134

PR submitted by the release tooling.
[skip ci]
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.

Compiler hangs instead of throwing error when expanding anonymous function
4 participants