Skip to content

Commit 525a187

Browse files
committed
Because to_be doesn't have static type checking, we can have mismatching types within a LiteralValue as a transient.
1 parent aba84c6 commit 525a187

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

python/selfie-lib/selfie_lib/WriteTracker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Dict, Generic, List, Optional, TypeVar, cast
88

99
from .FS import FS
10-
from .Literals import LiteralTodoStub, LiteralValue, TodoStub
10+
from .Literals import LiteralString, LiteralTodoStub, LiteralValue, TodoStub
1111
from .SourceFile import SourceFile
1212
from .TypedPath import TypedPath
1313

@@ -175,7 +175,11 @@ def record(
175175

176176
file = layout.sourcefile_for_call(call.location)
177177

178-
if snapshot.expected is not None:
178+
if (
179+
snapshot.expected is not None
180+
and isinstance(snapshot.expected, str)
181+
and isinstance(snapshot.format, LiteralString)
182+
):
179183
content = SourceFile(file.name, layout.fs.file_read(file))
180184
try:
181185
snapshot = cast(LiteralValue, snapshot)

0 commit comments

Comments
 (0)