diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index 5da841549..f507dc420 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -825,7 +825,7 @@ internal class AstChecker(private val program: Program, err("invalid import directive, cannot import itself") } "%breakpoint" -> { - if(directive.parent !is INameScope || directive.parent is Module) + if(directive.parent !is INameScope && directive.parent !is AnonymousScope || directive.parent is Module) err("this directive can't be used here") if(directive.args.isNotEmpty()) err("invalid breakpoint directive, expected no arguments")