Skip to content

Allow taking an unmanaged pointer off readonly lvalues #22306

@VSadov

Description

@VSadov

Historically we require that lvalue is writable before allowing taking a pointer.

That does not make a lot of sense. While there are ways to "cast away" readonliness, why is that even required before "casting away" most of the type system safeguards?

I think it is just an artifact of old implementation strategy that internally combined "lvalue" and "writeable".
Now that these concepts are properly separated, it makes sense to require that the target of "&" is an lvalue, but does not need to be writeable.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions