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

Disallow new MyObj.type #9457

Merged
merged 3 commits into from Jan 27, 2021
Merged

Disallow new MyObj.type #9457

merged 3 commits into from Jan 27, 2021

Conversation

Jasper-M
Copy link
Member

@Jasper-M Jasper-M commented Jan 26, 2021

... while still allowing classOf[MyObj.type].

Fixes scala/bug#12322

@scala-jenkins scala-jenkins added this to the 2.13.5 milestone Jan 26, 2021
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@SethTisue SethTisue merged commit 77c98d1 into scala:2.13.x Jan 27, 2021
@@ -4763,7 +4763,7 @@ trait Types
/** def isNonValueType(tp: Type) = !isValueElseNonValue(tp) */

def isNonRefinementClassType(tpe: Type) = tpe match {
case SingleType(_, sym) => sym.isModuleOrModuleClass
case SingleType(_, sym) => sym.isModuleClass
Copy link
Member

Choose a reason for hiding this comment

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

For the record: this reverts the change here that came from #9279, by moving it locally to typedClassOf.

@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Feb 9, 2021
@SethTisue SethTisue changed the title Don't allow module types for new, but do allow them for classOf Don't allow module types for new, but do allow them for classOf Feb 19, 2021
@SethTisue SethTisue changed the title Don't allow module types for new, but do allow them for classOf Allow classOf[Foo.type] Feb 19, 2021
@dwijnand dwijnand removed the release-notes worth highlighting in next release notes label Feb 22, 2021
@dwijnand
Copy link
Member

This is just a bug fix. #9279 was the improvement which we shipped and release noted in 2.13.4.

@dwijnand
Copy link
Member

dwijnand commented Feb 22, 2021

"Just" in the "no need to release note it" sense 🙇🏼 thank you for the fix!!

@Jasper-M
Copy link
Member Author

💔

@dwijnand dwijnand changed the title Allow classOf[Foo.type] Disallow new MyObj.type Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants