Skip to content

Commit 4c2ddff

Browse files
Merge pull request #5760 from dotty-staging/fix-#1342
Fix #1342: Add postcondition assertion
2 parents ed03afc + 239bf45 commit 4c2ddff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
5858
/** the following two members override abstract members in Transform */
5959
override def phaseName: String = PostTyper.name
6060

61+
override def checkPostCondition(tree: tpd.Tree)(implicit ctx: Context): Unit = tree match {
62+
case tree: ValOrDefDef =>
63+
assert(!tree.symbol.signature.isUnderDefined)
64+
case _ =>
65+
}
66+
6167
override def changesMembers: Boolean = true // the phase adds super accessors and synthetic methods
6268

6369
override def transformPhase(implicit ctx: Context): Phase = thisPhase.next

0 commit comments

Comments
 (0)