File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -2211,7 +2211,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2211
2211
if tycon.tpe.typeParams.nonEmpty then
2212
2212
typed(untpd.AppliedTypeTree (tyconSplice, tparam :: Nil ))
2213
2213
else if Feature .enabled(modularity) && tycon.tpe.member(tpnme.Self ).symbol.isAbstractType then
2214
- typed(untpd.RefinedTypeTree (tyconSplice, List (untpd.TypeDef (tpnme.Self , tparam))))
2214
+ val tparamSplice = untpd.TypedSplice (typedExpr(tparam))
2215
+ typed(untpd.RefinedTypeTree (tyconSplice, List (untpd.TypeDef (tpnme.Self , tparamSplice))))
2215
2216
else
2216
2217
errorTree(tree,
2217
2218
em """ Illegal context bound: ${tycon.tpe} does not take type parameters and
Original file line number Diff line number Diff line change 1
1
//> using options -language:experimental.modularity -source future
2
2
package hylotest
3
3
4
- trait Value [Self ]
4
+ trait Value :
5
+ type Self
6
+ extension (self : Self ) def eq (other : Self ): Boolean
5
7
6
8
/** A collection of elements accessible by their position. */
7
- trait Collection [Self ]:
9
+ trait Collection :
10
+ type Self
8
11
9
12
/** The type of the elements in the collection. */
10
13
type Element : Value
11
14
12
15
class BitArray
13
16
14
- given Value [Boolean ] {}
17
+ given Boolean is Value :
18
+ extension (self : Self ) def eq (other : Self ): Boolean =
19
+ self == other
15
20
16
- given Collection [ BitArray ] with
21
+ given BitArray is Collection :
17
22
type Element = Boolean
23
+
24
+ extension [Self : Value ](self : Self )
25
+ def neq (other : Self ): Boolean = ! self.eq(other)
You can’t perform that action at this time.
0 commit comments