File tree 3 files changed +21
-0
lines changed
compiler/src/dotty/tools/dotc/core/tasty
tests/neg-custom-args/captures
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ class TreePickler(pickler: TastyPickler) {
208
208
writeByte(if (tpe.isType) TYPEREFdirect else TERMREFdirect )
209
209
if Config .checkLevels && ! symRefs.contains(sym) && ! sym.isPatternBound && ! sym.hasAnnotation(defn.QuotedRuntimePatterns_patternTypeAnnot ) then
210
210
report.error(i " pickling reference to as yet undefined $tpe with symbol ${sym}" , sym.srcPos)
211
+ // todo: find out why this happens for pos-customargs/captures/capt2
211
212
pickleSymRef(sym)
212
213
}
213
214
else tpe.designator match {
Original file line number Diff line number Diff line change
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/class-contra.scala:12:39 ---------------------------------
2
+ 12 | def fun(x: K{val f: {a} T}) = x.setf(a) // error
3
+ | ^
4
+ | Found: (a : {x, y} T)
5
+ | Required: T
6
+
7
+ longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+
2
+ class C
3
+ type Cap = {* } C
4
+
5
+ class K (val f : {* } T ):
6
+ def setf (x : {f} T ) = ???
7
+
8
+ class T
9
+
10
+ def test (x : Cap , y : Cap ) =
11
+ val a : {x, y} T = ???
12
+ def fun (x : K {val f : {a} T }) = x.setf(a) // error
13
+ ()
You can’t perform that action at this time.
0 commit comments