File tree 2 files changed +34
-0
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,10 @@ object LiftCoverage extends LiftImpure {
194
194
val liftedArgs = liftArgs(defs, tree.fun.tpe, tree.args)(using liftingArgsContext)
195
195
tpd.cpy.Apply (tree)(liftedFun, liftedArgs)
196
196
}
197
+
198
+ override def liftedFlags : FlagSet = Method
199
+
200
+ override def liftedDef (sym : TermSymbol , rhs : tpd.Tree )(using Context ): tpd.DefDef = tpd.DefDef (sym, rhs)
197
201
}
198
202
199
203
object LiftErased extends LiftComplex :
Original file line number Diff line number Diff line change
1
+ // scalac: -coverage-out:coverage
2
+ // scalajs: --skip
3
+
4
+ import concurrent .ExecutionContext .Implicits .global
5
+ import scala .concurrent .*
6
+ import scala .concurrent .duration .*
7
+
8
+ var test = 0
9
+
10
+ def brokenSynchronizedBlock (option : Boolean ): Future [Unit ] = Future {
11
+ if (option) {
12
+ Thread .sleep(500 )
13
+ }
14
+ synchronized {
15
+ val tmp = test
16
+ Thread .sleep(1000 )
17
+ test = tmp + 1
18
+ }
19
+ }
20
+
21
+ object Test extends App {
22
+ Await .result(
23
+ Future .sequence(Seq (brokenSynchronizedBlock(false ), brokenSynchronizedBlock(true )))
24
+ .map { result =>
25
+ println(test)
26
+ assert(test == 2 )
27
+ },
28
+ 3 .seconds
29
+ )
30
+ }
You can’t perform that action at this time.
0 commit comments