File tree 2 files changed +25
-3
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -289,14 +289,15 @@ object Types {
289
289
def isFromJavaObject (using Context ): Boolean = typeSymbol eq defn.FromJavaObjectSymbol
290
290
291
291
/** True iff `symd` is a denotation of a class type parameter and the reference
292
- * `<this > . <symd>` is an actual argument reference, i.e. `this ` is different
293
- * from the ThisType of `symd`'s owner.
292
+ * `<pre > . <symd>` is an actual argument reference, i.e. `pre ` is not the
293
+ * ThisType of `symd`'s owner, or a reference to `symd`'s owner.'
294
294
*/
295
295
def isArgPrefixOf (symd : SymDenotation )(using Context ): Boolean =
296
296
symd.exists && ! symd.owner.is(Package ) && // Early exit if possible because the next check would force SymbolLoaders
297
297
symd.isAllOf(ClassTypeParam ) && {
298
298
this match {
299
299
case tp : ThisType => tp.cls ne symd.owner
300
+ case tp : TypeRef => tp.symbol ne symd.owner
300
301
case _ => true
301
302
}
302
303
}
@@ -2212,7 +2213,8 @@ object Types {
2212
2213
throw new TypeError (
2213
2214
i """ bad parameter reference $this at ${ctx.phase}
2214
2215
|the parameter is ${param.showLocated} but the prefix $prefix
2215
- |does not define any corresponding arguments. """ )
2216
+ |does not define any corresponding arguments.
2217
+ |idx = $idx, args = $args""" )
2216
2218
NoDenotation
2217
2219
}
2218
2220
}
Original file line number Diff line number Diff line change
1
+ object data {
2
+
3
+ trait OfType [T ]
4
+ case object IntT extends OfType [Int ]
5
+ case object DoubleT extends OfType [Double ]
6
+ case object FloatT extends OfType [Float ]
7
+
8
+ type DSeq [X ] = scala.collection.immutable.AbstractSeq [X ]
9
+
10
+ case class ColumnName [T ](n: String , t : OfType [T ])
11
+ case class Column [T ,F [_]<: DSeq [_]](n: F [T ], of : ColumnName [T ])
12
+ }
13
+
14
+ def min4 [T ,F [_]<: data.DSeq [T ]](col : data.Column [T ,F ])(using Ordering [T ]): T = {
15
+ col match {
16
+ case c: data.Column [Int ,_] => c.n.min[T ](Ordering [T ])
17
+ case _:data.Column [Double ,_] => ???
18
+ case _:data.Column [Float ,_] => ???
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments