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

private[this] に関して注釈を追加する #982

Open
rinotc opened this issue Aug 1, 2022 · 3 comments
Open

private[this] に関して注釈を追加する #982

rinotc opened this issue Aug 1, 2022 · 3 comments

Comments

@rinotc
Copy link
Contributor

rinotc commented Aug 1, 2022

Scala3 では private[this], protected[this] は廃止予定なので、注釈を記載した方がよさそう。

https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html

@xuwei-k
Copy link
Contributor

xuwei-k commented Aug 1, 2022

まだ普通にコンパイルしただけでは警告すら出なかった気がする(うろ覚え)から、優先度高くないというか、状況しっかり調べてからの方が良さそう

@kmizu
Copy link
Contributor

kmizu commented Aug 15, 2022

@rinotc @xuwei-k さっき調べたんですが、Scala 3.1.0でも普通に使えた上に警告すら出ない

[mizushima]$ scala -deprecation
Welcome to Scala 3.1.0 (17.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> class Foo {
     |   private[this] val v = 1
     | }
// defined class Foo

scala> class Bar {
     |   protected[this] val v = 2
     | }
// defined class Bar```

ので、いったんcloseでいいかなと思います(実際にdeprecatedになったタイミングで良さそう)。

@kmizu kmizu closed this as completed Aug 15, 2022
@xuwei-k
Copy link
Contributor

xuwei-k commented Nov 8, 2023

@xuwei-k xuwei-k reopened this Nov 8, 2023
@xuwei-k xuwei-k changed the title private[this] に関して注釈を追加する private[this] に関して注釈を追加する Jan 7, 2024
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

No branches or pull requests

3 participants