Skip to content

Commit 06d3f7a

Browse files
Merge pull request #2039 from dotty-staging/add-refined-assert
Add assert that refine infos are legal wrt refined names
2 parents 761b1fd + 7c7c1f0 commit 06d3f7a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,9 @@ object Types {
20662066
*/
20672067
abstract case class RefinedType(parent: Type, refinedName: Name, refinedInfo: Type) extends RefinedOrRecType {
20682068

2069+
if (refinedName.isTermName) assert(refinedInfo.isInstanceOf[TermType])
2070+
else assert(refinedInfo.isInstanceOf[TypeType])
2071+
20692072
override def underlying(implicit ctx: Context) = parent
20702073

20712074
private def badInst =

0 commit comments

Comments
 (0)