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
From the PR that added readonly (#29435) there was a question about the behaviour of types called readonlyhere. The following used to compile, but does not currently:
typereadonly=string;constq: readonly='hello';
I think there was a plan to fix this, but maybe though would need to be reviewed in light of this proposal.
Hrm great point - I actually can't think of any reason why as const doesn't cover this other than for the exact case I was looking at (which was to show a particular error message )
Activity
RyanCavanaugh commentedon Aug 12, 2019
Can you compare and contrast with how
as constdoesn't address this use case?jack-williams commentedon Aug 13, 2019
From the PR that added
readonly(#29435) there was a question about the behaviour of types calledreadonlyhere. The following used to compile, but does not currently:I think there was a plan to fix this, but maybe though would need to be reviewed in light of this proposal.
orta commentedon Aug 13, 2019
Hrm great point - I actually can't think of any reason why
as constdoesn't cover this other than for the exact case I was looking at (which was to show a particular error message )I'm fine with this being considered closed 👍
RyanCavanaugh commentedon Aug 14, 2019
As an aside I think we're happy with
readonlybeing (unintentionally?) reserved for the time being - who knows what we might want with it later.