File tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/ast
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -774,7 +774,7 @@ object desugar {
774
774
* companion object, and the synthetic opaque type member will go into the self type.
775
775
*/
776
776
def opaqueAlias (tdef : TypeDef )(implicit ctx : Context ): Tree =
777
- if (tdef.rhs. isInstanceOf [ TypeBoundsTree ] ) {
777
+ if (lacksDefinition( tdef) ) {
778
778
ctx.error(em " opaque type ${tdef.name} must be an alias type " , tdef.sourcePos)
779
779
tdef.withFlags(tdef.mods.flags &~ Opaque )
780
780
}
Original file line number Diff line number Diff line change
1
+ opaque type i0 // error: opaque type must be an alias type
2
+ opaque type i2 <: Int // error: opaque type must be an alias type
3
+
4
+ opaque type i1 [_] // error: opaque type must be an alias type
5
+ opaque type x [_] <: Int // error: opaque type must be an alias type
You can’t perform that action at this time.
0 commit comments