Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes three things.
@bastewart pointed out today that the synthetic golden filenames collide for generic types with different type parameters (e.g.
List[Int]
andList[String]
would have the same name). He also noted that the regex used to match files and names breaks if you manually provide a name like"List[Int]"
.I've changed the name inferrer thingy to include type parameters in the name. The default encoding turns
MyTuple[MyList[Wub], MyList[MyList[Foo]]]
intoMyTuple_MyList_Wub_MyList_MyList_Foo
. I don't particular care about the specifics here, but using underscores seems simple, likely not to cause problems across platforms, and doesn't collide with the hyphen used to set off the seed in the filename.I've changed the first part of the regex (the comparing names part) to a simple call to
startsWith
, and then use a modified regex to pull out the seed and validate the rest of the name (which is a static format—no interpolation of possibly arbitrary user stuff).Also for some reason (like my inability to work effectively with horrible types like
Int
) I originally reversed the order of thesize
andcount
parameters in one ofResourceFileGoldenCodecLaws
'sapply
overloads. I changed them to be consistent with the other overloads. This is bincompat becauseInt
. Hopefully nobody's actually used this overload (if they have they might get a surprise the next time they run their tests, but it should be easy enough to figure out what's up).