Skip to content

Commit d468cf1

Browse files
committed
Merge remote-tracking branch 'upstream/main' into flexible-types
Handle flexible types in isConcrete.
2 parents af0e504 + fd2a03e commit d468cf1

File tree

99 files changed

+263
-3117
lines changed

Some content is hidden

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

99 files changed

+263
-3117
lines changed

.github/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:22.04
2+
3+
# The default locale is "POSIX" which is just ASCII.
4+
ENV LANG C.UTF-8
5+
ENV DEBIAN_FRONTEND noninteractive
6+
ENV TZ Europe/Zurich
7+
8+
# Add packages to image, set default JDK version
9+
RUN apt-get update && \
10+
apt-get upgrade -y && \
11+
# Use a PPA to get Java 17
12+
apt-get install -y software-properties-common && add-apt-repository ppa:openjdk-r/ppa && \
13+
apt-get install -y bash curl git ssh htop nano vim-tiny zile \
14+
openjdk-8-jdk-headless \
15+
openjdk-17-jdk-headless \
16+
openjdk-21-jdk-headless && \
17+
(curl -fsSL https://deb.nodesource.com/setup_18.x | bash -) && \
18+
apt-get install -y nodejs
19+
20+
21+
# Install sbt
22+
ENV SBT_HOME /usr/local/sbt
23+
ENV PATH ${SBT_HOME}/bin:${PATH}
24+
ENV SBT_VERSION 1.9.0
25+
RUN curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local

.github/dependabot.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
version: 2
22
updates:
3-
4-
- package-ecosystem: "github-actions"
3+
- package-ecosystem: github-actions
54
directory: "/"
65
schedule:
7-
interval: "weekly"
6+
interval: weekly
7+
assignees:
8+
- hamzaremmal
9+
reviewers:
10+
- hamzaremmal

.github/workflows/lts-backport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
- uses: coursier/cache-action@v6
18-
- uses: VirtusLab/[email protected].0
18+
- uses: VirtusLab/[email protected].1
1919
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
2020
env:
2121
GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}

.github/workflows/spec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
env:
4646
USER_FOR_TEST: ${{ secrets.SPEC_DEPLOY_USER }}
4747
if: ${{ env.USER_FOR_TEST != '' }}
48-
uses: burnett01/[email protected].0
48+
uses: burnett01/[email protected].1
4949
with:
5050
switches: -rzv
5151
path: docs/_spec/_site/

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,12 +1943,27 @@ object desugar {
19431943
case AndType(tp1, tp2) => stripToCore(tp1) ::: stripToCore(tp2)
19441944
case _ => defn.AnyType :: Nil
19451945
}
1946+
1947+
val refinements1 = Trees.flatten:
1948+
refinements.mapConserve {
1949+
case tree: ValDef if tree.mods.is(Mutable) =>
1950+
val getter =
1951+
cpy.DefDef(tree)(name = tree.name, paramss = Nil, tpt = tree.tpt, rhs = tree.rhs)
1952+
.withFlags(tree.mods.flags & (AccessFlags | Synthetic))
1953+
val setterParam = makeSyntheticParameter(tpt = tree.tpt)
1954+
val setter =
1955+
cpy.DefDef(tree)(name = tree.name.setterName, paramss = List(List(setterParam)), tpt = untpd.scalaUnit, rhs = EmptyTree)
1956+
.withFlags(tree.mods.flags & (AccessFlags | Synthetic))
1957+
Thicket(getter, setter)
1958+
case tree => tree
1959+
}
1960+
19461961
val parentCores = stripToCore(parent.tpe)
19471962
val untpdParent = TypedSplice(parent)
19481963
val (classParents, self) =
19491964
if (parentCores.length == 1 && (parent.tpe eq parentCores.head)) (untpdParent :: Nil, EmptyValDef)
19501965
else (parentCores map TypeTree, ValDef(nme.WILDCARD, untpdParent, EmptyTree))
1951-
val impl = Template(emptyConstructor, classParents, Nil, self, refinements)
1966+
val impl = Template(emptyConstructor, classParents, Nil, self, refinements1)
19521967
TypeDef(tpnme.REFINE_CLASS, impl).withFlags(Trait)
19531968
}
19541969

0 commit comments

Comments
 (0)