Skip to content

Commit

Permalink
Update isCompatibleType doc comment to remove specific reference to s…
Browse files Browse the repository at this point in the history
…tring literal types (#46)
  • Loading branch information
jasongwartz authored Apr 1, 2024
1 parent 883e53c commit ab4799a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions codegen/src/internal/ClassGen.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ local function isSameType(typeA: reflect.Type, typeB: reflect.Type) =
// but we will pretend it is always false for now.
else false

// TypeScript allows extending interfaces to override properties from the parent interface as long
// as the new type is compatible with the parent property's type. One useful example of this, and
// the only current supported way below, is when the parent type is String-type, and the child type is a string-literal type.
// In the future we could add more detailed compatibility checks.
// TypeScript allows extending interfaces to override properties from the parent interface, as long
// as the new type is compatible with the parent property's type. This check is not exhaustive and
// will likely be updated over time.
local function isCompatibleType(parentType: reflect.Type, childType: reflect.Type) =
(
parentType is reflect.DeclaredType &&
Expand Down

0 comments on commit ab4799a

Please sign in to comment.