8000 fastmod --accept-all 'super type' supertype by jez · Pull Request #8894 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fastmod --accept-all 'super type' supertype #8894

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

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ class Types final {
/** Greater lower bound: the widest type that is subtype of both t1 and t2 */
static TypePtr all(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2);

/** Lower upper bound: the narrowest type that is super type of both t1 and t2 */
/** Lower upper bound: the narrowest type that is supertype of both t1 and t2 */
static TypePtr any(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2);

/**
* is every instance of t1 an instance of t2?
*
* The parameter `mode` controls whether or not `T.untyped` is
* considered to be a super type or subtype of all other types */
* considered to be a supertype or subtype of all other types */

/**
* The `errorDetailsCollector` parameter is used to pass additional details out of isSubType
Expand Down Expand Up @@ -106,7 +106,7 @@ class Types final {
static bool equivUnderConstraint(const GlobalState &gs, TypeConstraint &constr, const TypePtr &t1,
const TypePtr &t2, T &errorDetailsCollector);

/** check that t1 <: t2, but do not consider `T.untyped` as super type or a subtype of all other types */
/** check that t1 <: t2, but do not consider `T.untyped` as supertype or a subtype of all other types */
static bool isAsSpecificAs(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2);
static bool equivNoUntyped(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2);

Expand Down
4 changes: 2 additions & 2 deletions core/types/subtyping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ TypePtr lubGround(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2);

TypePtr Types::any(const GlobalState &gs, const TypePtr &t1, const TypePtr &t2) {
auto ret = lub(gs, t1, t2);
SLOW_ENFORCE(Types::isSubType(gs, t1, ret), "\n{}\nis not a super type of\n{}\nwas lubbing with {}",
SLOW_ENFORCE(Types::isSubType(gs, t1, ret), "\n{}\nis not a supertype of\n{}\nwas lubbing with {}",
ret.toString(gs), t1.toString(gs), t2.toString(gs));
SLOW_ENFORCE(Types::isSubType(gs, t2, ret), "\n{}\nis not a super type of\n{}\nwas lubbing with {}",
SLOW_ENFORCE(Types::isSubType(gs, t2, ret), "\n{}\nis not a supertype of\n{}\nwas lubbing with {}",
ret.toString(gs), t2.toString(gs), t1.toString(gs));

// TODO: @dmitry, reenable
Expand Down
2 changes: 1 addition & 1 deletion website/docs/anything.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ that the type is what they expect.
- `T.anything` is a supertype of all other types, **but** is not a subtype of
any other type (except itself).

- `T.untyped` is a super type of all other types, **and** is a subtype of all
- `T.untyped` is a supertype of all other types, **and** is a subtype of all
other types (which is a contradiction that lies at the core of a
[gradual type system](gradual.md)).

Expand Down
0