Skip to content

Commit daaa3c7

Browse files
authored
Fix labels for list-types in $SetReplaceTypeGraph (#625)
## Changes * Labels for types that are lists (e.g., `{MultisetSubstitutionSystem, 0}`) don't currently show correctly due to `Graph` interpreting `MultisetSubstitutionSystem` and `0` as separate labels and plotting them on top of each other. * This PR fixes that by converting labels to strings. ## Examples * Declare a type: ```wl SetReplace`PackageScope`declareTypeTranslation[Identity, {String, 0}, {Integer, 0}]; Unprotect[$SetReplaceTypes]; Unprotect[$SetReplaceProperties]; Unprotect[$SetReplaceTypeGraph]; SetReplace`PackageScope`initializeTypeSystem[]; ``` * Show a type graph which is now rendered correctly: ```wl In[] := $SetReplaceTypeGraph ``` <img width="478" alt="image" src="https://user-images.githubusercontent.com/1479325/111526067-47551080-872c-11eb-86db-235d9d17f16d.png">
1 parent 5707163 commit daaa3c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Kernel/A1$typeSystem.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204

205205
typeGraphVertexLabel[kind_, name_] :=
206206
If[!freeFromInternalSymbolsQ[name] || kind === SetReplaceMethodImplementation, Placed[#, Tooltip] &, Identity] @
207-
If[kind === SetReplaceProperty, ToString[#] <> "[\[Ellipsis]]" &, Identity] @
207+
If[kind === SetReplaceProperty, ToString[#] <> "[\[Ellipsis]]" &, ToString] @
208208
name;
209209

210210
insertImplementationVertex[inputEdge : DirectedEdge[from_, to_]] := ModuleScope[

0 commit comments

Comments
 (0)