Skip to content

Commit 11b5a40

Browse files
committed
Include all top-level declarations as exported identifiers
1 parent 9008c92 commit 11b5a40

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

internal/cadence/linter.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,12 @@ func (l *linter) getExportedIdentifiers(filePath string) []ast.Identifier {
553553

554554
func exportedIdentifiersFromProgram(program *ast.Program) []ast.Identifier {
555555
var identifiers []ast.Identifier
556-
for _, decl := range program.CompositeDeclarations() {
557-
identifiers = append(identifiers, decl.Identifier)
558-
}
559-
for _, decl := range program.InterfaceDeclarations() {
560-
identifiers = append(identifiers, decl.Identifier)
556+
for _, decl := range program.Declarations() {
557+
identifier := decl.DeclarationIdentifier()
558+
if identifier == nil {
559+
continue
560+
}
561+
identifiers = append(identifiers, *identifier)
561562
}
562563
return identifiers
563564
}

0 commit comments

Comments
 (0)