-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shadowing Js.Json.t with type kind #6317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. @cristianoc any thoughts?
jscomp/others/js_json.res
Outdated
| Boolean: kind<bool> | ||
| Null: kind<Js_types.null_val> | ||
module Kind = { | ||
type rec kind<_> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s / kind / t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I picked s
. 7a8880b
CHANGELOG.md
Outdated
@@ -14,6 +14,9 @@ | |||
#### :rocket: New Feature | |||
- Variants: Allow coercing from variant to variant, where applicable. https://github.com/rescript-lang/rescript-compiler/pull/6314 | |||
|
|||
#### :boom: Breaking Change | |||
- Fixed Js.Json.kind type shadowing Js.Json.t type: `type kind<_>` -> `type Kind.kind<_>` https://github.com/rescript-lang/rescript-compiler/pull/6317 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should say what the breaking change is and what is the fix for someone relying on the previous behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jscomp/others/js_json.res
Outdated
| Boolean: kind<bool> | ||
| Null: kind<Js_types.null_val> | ||
module Kind = { | ||
type rec s<_> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ s / t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand your notation, but
s / kind / t 695bb47
This reverts commit 7a8880b.
CHANGELOG.md
Outdated
@@ -14,6 +14,9 @@ | |||
#### :rocket: New Feature | |||
- Variants: Allow coercing from variant to variant, where applicable. https://github.com/rescript-lang/rescript-compiler/pull/6314 | |||
|
|||
#### :boom: Breaking Change | |||
- Fixed the issue of name collision between the newly defined Js.Json.t and the variant constructor in the existing Js.Json.kind type. To address this, the usage of the existing Js.Json.kind type can be updated to Js.Json.Kind.s. https://github.com/rescript-lang/rescript-compiler/pull/6317 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s / s / t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s / kind / t 7f3959d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why it's not t
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it's idiomatic for types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ended up being t
, s
was just a confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is t.
type t
module Kind = {
type json = t
type t
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see 😁
This PR fixes an issue with existing Js.Json.kind types shadowing the variant constructor of Js.Json.t types.