Skip to content

Commit

Permalink
Migrate pyre_extensions.ReadOnly to pyre_extensions.PyreReadOnly] fbc…
Browse files Browse the repository at this point in the history
…ode/tools/pyre/source

Reviewed By: arthaud

Differential Revision: D63968581

fbshipit-source-id: 3e1bf19b856bee535d871273908a69e8fbe0dbae
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Oct 7, 2024
1 parent 35ee4c3 commit d84c89b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from builtins import _test_source, _test_sink
from typing import Any, MutableMapping
from typing_extensions import Self
from pyre_extensions import ReadOnly
from pyre_extensions import PyreReadOnly


class A:
Expand All @@ -15,7 +15,7 @@ def __init__(self) -> None:
self.mapping: MutableMapping[str, Any] = {}

def self_readonly_str(
self: ReadOnly[Self]
self: PyreReadOnly[Self]
) -> None:
_test_sink(self.B)

Expand All @@ -25,7 +25,7 @@ def self_untyped_str(
_test_sink(self.B)

def self_readonly_map(
self: ReadOnly[Self]
self: PyreReadOnly[Self]
) -> None:
# pyre-ignore[3005]: Ignore ReadOnly Violation
_test_sink(self.mapping.get(""))
Expand All @@ -35,7 +35,7 @@ def self_untyped_map(
) -> None:
_test_sink(self.mapping.get(""))

def readonly_tito(self, x: ReadOnly[str]):
def readonly_tito(self, x: PyreReadOnly[str]):
return x


Expand All @@ -50,11 +50,11 @@ class Foo:
not_tainted: str = ""


def readonly_foo_tainted(foo: ReadOnly[Foo]) -> None:
def readonly_foo_tainted(foo: PyreReadOnly[Foo]) -> None:
_test_sink(foo.tainted)


def readonly_foo_not_tainted(foo: ReadOnly[Foo]) -> None:
def readonly_foo_not_tainted(foo: PyreReadOnly[Foo]) -> None:
_test_sink(foo.not_tainted)


Expand Down

0 comments on commit d84c89b

Please sign in to comment.