Skip to content

Commit 295229f

Browse files
authored
Merge branch 'scala:main' into concurrency-cc
2 parents 51d3fd2 + dcf176b commit 295229f

File tree

326 files changed

+7625
-2795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+7625
-2795
lines changed

.github/workflows/lts-backport.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ on:
77

88
jobs:
99
add-to-backporting-project:
10-
if: "!contains(github.event.push.head_commit.message, '[Next only]')"
10+
if: "!contains(github.event.push.head_commit.message, '[Next only]') &&
11+
github.repository == 'scala/scala3'"
1112
runs-on: ubuntu-latest
1213

1314
steps:
1415
- uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 0
1718
- uses: coursier/cache-action@v6
18-
- uses: VirtusLab/[email protected].0
19+
- uses: VirtusLab/[email protected].1
1920
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
2021
env:
2122
GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}

.github/workflows/publish-sdkman.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- platform: WINDOWS_64
4747
archive : 'scala3-${{ inputs.version }}-x86_64-pc-win32.zip'
4848
steps:
49-
- uses: sdkman/sdkman-release-action@a60691d56279724b4c9ff0399c0ae21d641ab75e
49+
- uses: sdkman/sdkman-release-action@2800d4359ae097a99afea7e0370f0c6e726182a4
5050
with:
5151
CONSUMER-KEY : ${{ secrets.CONSUMER-KEY }}
5252
CONSUMER-TOKEN : ${{ secrets.CONSUMER-TOKEN }}

.jvmopts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-Xss1m
2-
-Xms512m
3-
-Xmx4096m
2+
-Xms1024m
3+
-Xmx8192m
44
-XX:MaxInlineLevel=35
55
-XX:ReservedCodeCacheSize=512m

community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ object CommunityBuildRunner:
1313
* is necessary since we run tests each time on a fresh
1414
* Docker container. We run the update on Docker container
1515
* creation time to create the cache of the dependencies
16-
* and avoid network overhead. See https://github.com/lampepfl/dotty-drone
17-
* for more infrastructural details.
16+
* and avoid network overhead.
1817
*/
1918
extension (self: CommunityProject)
2019
def run()(using suite: CommunityBuildRunner): Unit =

compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I, val frontendAcce
285285
// tests/run/serialize.scala and https://github.com/typelevel/cats-effect/pull/2360).
286286
val privateFlag = !sym.isClass && (sym.is(Private) || (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass))
287287

288-
val finalFlag = sym.is(Final) && !toDenot(sym).isClassConstructor && !sym.is(Mutable, butNot = Accessor) && !sym.enclosingClass.is(Trait)
288+
val finalFlag = sym.is(Final) && !toDenot(sym).isClassConstructor && !sym.isMutableVar && !sym.enclosingClass.is(Trait)
289289

290290
import asm.Opcodes.*
291291
import GenBCodeOps.addFlagIf

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,8 @@ object desugar {
22622262
New(ref(defn.RepeatedAnnot.typeRef), Nil :: Nil))
22632263
else if op.name == nme.CC_REACH then
22642264
Apply(ref(defn.Caps_reachCapability), t :: Nil)
2265+
else if op.name == nme.CC_READONLY then
2266+
Apply(ref(defn.Caps_readOnlyCapability), t :: Nil)
22652267
else
22662268
assert(ctx.mode.isExpr || ctx.reporter.errorsReported || ctx.mode.is(Mode.Interactive), ctx.mode)
22672269
Select(t, op.name)

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
759759
*/
760760
def isVariableOrGetter(tree: Tree)(using Context): Boolean = {
761761
def sym = tree.symbol
762-
def isVar = sym.is(Mutable)
762+
def isVar = sym.isMutableVarOrAccessor
763763
def isGetter =
764764
mayBeVarGetter(sym) && sym.owner.info.member(sym.name.asTermName.setterName).exists
765765

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
206206

207207
case class Var()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Mutable)
208208

209+
case class Mut()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Mutable)
210+
209211
case class Implicit()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Implicit)
210212

211213
case class Given()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Given)
@@ -332,6 +334,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
332334

333335
def isEnumCase: Boolean = isEnum && is(Case)
334336
def isEnumClass: Boolean = isEnum && !is(Case)
337+
def isMutableVar: Boolean = is(Mutable) && mods.exists(_.isInstanceOf[Mod.Var])
335338
}
336339

337340
@sharable val EmptyModifiers: Modifiers = Modifiers()
@@ -518,14 +521,17 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
518521
def scalaUnit(implicit src: SourceFile): Select = scalaDot(tpnme.Unit)
519522
def scalaAny(implicit src: SourceFile): Select = scalaDot(tpnme.Any)
520523

524+
def capsInternalDot(name: Name)(using SourceFile): Select =
525+
Select(Select(scalaDot(nme.caps), nme.internal), name)
526+
521527
def captureRoot(using Context): Select =
522528
Select(scalaDot(nme.caps), nme.CAPTURE_ROOT)
523529

524530
def makeRetaining(parent: Tree, refs: List[Tree], annotName: TypeName)(using Context): Annotated =
525531
Annotated(parent, New(scalaAnnotationDot(annotName), List(refs)))
526532

527533
def makeCapsOf(tp: RefTree)(using Context): Tree =
528-
TypeApply(Select(scalaDot(nme.caps), nme.capsOf), tp :: Nil)
534+
TypeApply(capsInternalDot(nme.capsOf), tp :: Nil)
529535

530536
// Capture set variable `[C^]` becomes: `[C >: CapSet <: CapSet^{cap}]`
531537
def makeCapsBound()(using Context): TypeBoundsTree =

compiler/src/dotty/tools/dotc/cc/CaptureAnnotation.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ case class CaptureAnnotation(refs: CaptureSet, boxed: Boolean)(cls: Symbol) exte
4242
case cr: TermRef => ref(cr)
4343
case cr: TermParamRef => untpd.Ident(cr.paramName).withType(cr)
4444
case cr: ThisType => This(cr.cls)
45-
// TODO: Will crash if the type is an annotated type, for example `cap?`
45+
case root(_) => ref(root.cap)
46+
// TODO: Will crash if the type is an annotated type, for example `cap.rd`
4647
}
4748
val arg = repeated(elems, TypeTree(defn.AnyType))
4849
New(symbol.typeRef, arg :: Nil)

0 commit comments

Comments
 (0)