Skip to content

Change 'is abstract; cannot be instantiated' to Message #2012

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

Merged
merged 2 commits into from
Feb 22, 2017

Conversation

ennru
Copy link
Contributor

@ennru ennru commented Feb 20, 2017

@felixmulder
Next error to the case class scheme. Called its kind "Usage Error" - maybe the error kinds should be defined.

val kind = "Usage"
private val traitOrAbstract = if (isTrait) hl"a trait" else hl"abstract"
val msg = hl"""${cls.name} is ${traitOrAbstract}; it cannot be instantiated"""
val explanation = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps an explanation here to say you can use:

new TraitName { }

To instantiate it?

Copy link
Contributor

Choose a reason for hiding this comment

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

But of course using the actual symbol name..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, could be good.
I thought of mentioning the object TraitName extends TraitName pattern which is quite common.

@felixmulder felixmulder merged commit 43612f9 into scala:master Feb 22, 2017
@felixmulder
Copy link
Contributor

Great! Thanks @ennru 🎉

@ennru ennru deleted the ennru_CantInstantiateAbstract branch February 22, 2017 21:14
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