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
Better error message for "Cannot find name" when looking for a type #7900
This is working as intended (as noted, type is only a type; use a const + type pair if you want both definitions), but we should give a better error message when this happens like we do in other cases where symbol resolution fails in one namespace but would succeed in another.
This error message should be general to all cases where you refer to an identifier in a value position which only resolves to something in the type namespace. In other words:
interfaceJustAType{}varx=JustAType;// Error: __(fill in the blank)__
I was thinking something like
Cannot find name 'JustAType'. A type exists with this name, but no value.
Activity
jwbay commentedon Apr 6, 2016
a type alias is a compile-time construct. there's no javascript emitted for it, so you can't
newit up.RyanCavanaugh commentedon Apr 6, 2016
This is working as intended (as noted,
typeis only a type; use aconst+typepair if you want both definitions), but we should give a better error message when this happens like we do in other cases where symbol resolution fails in one namespace but would succeed in another.[-]Cannot create object using alias[/-][+]Better error message for "Cannot find name" when looking for a type[/+]hleimig commentedon Jul 23, 2016
What do you guys think of
RyanCavanaugh commentedon Jul 25, 2016
This error message should be general to all cases where you refer to an identifier in a value position which only resolves to something in the type namespace. In other words:
I was thinking something like
mhegazy commentedon Sep 13, 2016
thanks jwbay!