Skip to content

ObsoleteGlobalInspection

Max Dörner edited this page Jun 2, 2019 · 3 revisions

Description: Use of obsolete Global access modifier

Type: CodeInspectionType.LanguageOpportunities

Default severity: CodeInspectionSeverity.Suggestion

This inspection finds public fields declared with the obsolete Global access modifier.

Example:

Field foo is declared with the obsolete Global access modifier:

Global foo As Integer

Global is redundant and confusing, and was deprecated in favor of Public. Globals are a code smell anyway, right?


QuickFixes

QuickFix: Replace 'Global' access modifier with 'Public'

Public foo As Integer

Global can only be specified in standard code modules. Public fields in standard code modules have exactly the same scope; this quickfix replaces the deprecated access modifier with the Public keyword.

Clone this wiki locally