core icon indicating copy to clipboard operation
core copied to clipboard

hongbo/linked hashset test

Open bobzhang opened this issue 1 year ago • 2 comments

  • failed: the location of first argument cannot be None

cc @lijunchen

bobzhang avatar Oct 12 '24 06:10 bobzhang

Observed Problems in linked_hash_set_test.mbt

  1. Comment Misplacement: The commented line (// @json.inspect!([..h])) has been uncommented and moved to the next line (@json.inspect!([..h])). This change might not be intentional, and it's important to ensure that this line is supposed to be executed as code. If it's for debugging purposes and you wish to keep it as a comment, revert it back to a comment.

  2. Potential Redundancy: The line @json.inspect!([..h]) might be redundant since you are already inspecting v right after it, and v is set to [..h]. If the intention was to inspect the set before converting it to an array, it would make more sense to keep both lines. However, if inspecting the array v is sufficient, consider removing @json.inspect!([..h]) to avoid redundant outputs.

  3. Syntax in Comments: Ensure that any code-like syntax within comments is purely for documentation purposes and does not mislead future developers into thinking it's executable code. In this case, it seems like a debugging statement was commented out and then uncommented, which could lead to confusion if not properly documented.

Suggestions

  • Review Debugging Statements: Ensure that all debugging statements (like @json.inspect!) are necessary and serve a clear purpose. If they are no longer needed, remove them to keep the code clean and free of potential clutter.

  • Document Changes: If the uncommenting of @json.inspect!([..h]) was intentional, add a comment explaining why this line is necessary or what it helps to debug. This will aid in understanding the code better in the future.

  • Check for Redundancy: If the output of @json.inspect!([..h]) is the same as @json.inspect!(v, content=[1, 2, 3, 4, 5]), consider removing the former to avoid redundant outputs in the testing phase.

These observations and suggestions aim to enhance clarity, reduce redundancy, and ensure that debugging statements are both necessary and well-documented.

The array spread's location info looks lost; I've filed an issue in moonc repo.

lijunchen avatar Oct 12 '24 08:10 lijunchen

fixed in master

bobzhang avatar May 06 '25 03:05 bobzhang