File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -774,7 +774,7 @@ object desugar {
774774 * companion object, and the synthetic opaque type member will go into the self type.
775775 */
776776 def opaqueAlias (tdef : TypeDef )(implicit ctx : Context ): Tree =
777- if (tdef.rhs. isInstanceOf [ TypeBoundsTree ] ) {
777+ if (lacksDefinition( tdef) ) {
778778 ctx.error(em " opaque type ${tdef.name} must be an alias type " , tdef.sourcePos)
779779 tdef.withFlags(tdef.mods.flags &~ Opaque )
780780 }
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