You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ Typechecker ] File-level attribute annotations are not typechecked when file declares zero non-const entities #9508
Describe the bug
When declaring a file attribute, the typechecker should make sure the attribute class exists and that the constructor arguments typecheck. This check is not performed when the file does not declare any entities, or if all the declared entities are top-level constant declarations.
Standalone code, or other way to reproduce the problem
<<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>><<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>>
function f(): void {}<<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>>
const int X = 1;
const int Y = 2;
const int Z = X + Y;
changed the title [-]File-level attribute annotations are not typechecked when file declares zero non-const entities[/-][+][ Typechecker ] File-level attribute annotations are not typechecked when file declares zero non-const entities[/+]on Jun 10, 2026
Activity
payal76027-svg commentedon Aug 27, 2025
<<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>><<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>>
function f(): void {}<<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>>
const int X = 1;
const int Y = 2;
const int Z = X + Y;
haowanaa commentedon Aug 27, 2025
ktmb9494-oss commentedon Nov 20, 2025
<<file: ThisDoesNotExist(ThisIsNotBeingChecked::class)>>
function f(): void {}
ktmb9494-oss commentedon Nov 20, 2025
[-]File-level attribute annotations are not typechecked when file declares zero non-const entities[/-][+][ Typechecker ] File-level attribute annotations are not typechecked when file declares zero non-const entities[/+]