-
Notifications
You must be signed in to change notification settings - Fork 233
Add basic support for tracked
parameters
#3959
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update two suites:
[error] scala.meta.tests.trees.ReflectionSuite
[error] scala.meta.tests.api.SurfaceSuite
And maybe we should add this as a dialect option?
scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/SoftKeywords.scala
Outdated
Show resolved
Hide resolved
scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScalametaParser.scala
Outdated
Show resolved
Hide resolved
|
||
import scala.meta._ | ||
|
||
class LanguageExtensionsSuite extends BaseDottySuite { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know if we need a separate suite for just one modifier and 4 tests. isn't there already a suitable one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a new suite, so that we can put all the other new language extension features there. Is that ok, or should I move it somewhere?
There are quite a few extensions missing here, so the test suite can fill up quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you like to add these tests, too? 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the ones that aren't implemented here yet.
e.g.
into
namedTuples
captureChecking
namedTypeArguments
- etc.
val allowBinaryLiterals: Boolean | ||
val allowBinaryLiterals: Boolean, | ||
// Are tracked parameters allowed? docs: https://dotty.epfl.ch/docs/reference/experimental/modularity.html | ||
val allowTrackedParameters: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, is this feature part of an approved SIP, or released scala version? adding experimental stuff that may or may not be adopted is premature otherwise.
we have not yet implemented 3.4 parsing so I would start with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is available under an experimental language flag in 3.5.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be safe to this to ScalaFuture as it will not be too much problem to remove it in the future. I would agree in terms of bigger features, but here it's rather safe.
I can follow up with 3.4.0 and 3.5.0 dialects later on.
9a3e630
to
a42bcc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from me
@kitbellew are you ok with merging? I can follow up with making sure that the dialects are up to date.
val allowBinaryLiterals: Boolean | ||
val allowBinaryLiterals: Boolean, | ||
// Are tracked parameters allowed? docs: https://dotty.epfl.ch/docs/reference/experimental/modularity.html | ||
val allowTrackedParameters: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be safe to this to ScalaFuture as it will not be too much problem to remove it in the future. I would agree in terms of bigger features, but here it's rather safe.
I can follow up with 3.4.0 and 3.5.0 dialects later on.
overall, looks ok, but the code is not properly formatted yet 🙂 |
@kitbellew I just noticed it too. I pushed a new update right now 😅 |
This PR adds basic support for the experimental
tracked
modifier.Relevant links:
Any feedback will be appreciated.