What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This adds a small but significant optimization to the type checker. In essence types now have two new methods hasSuffix and getSuffix. These are in addition to suffixes which would generate all suffixes available on this type. While suffixes is useful for autocomplete it is primarily unnecessary during type checking as we just need to know if a given identifier corresponds to a valid suffix. By replacing suffixes().get(ident) and suffixes().has(ident) with getSuffix(ident) and hasSuffix(ident) the typechecker is now ~30% and uses ~50% less memory.
hasSuffix
andgetSuffix
. These are in addition tosuffixes
which would generate all suffixes available on this type. While suffixes is useful for autocomplete it is primarily unnecessary during type checking as we just need to know if a given identifier corresponds to a valid suffix. By replacingsuffixes().get(ident)
andsuffixes().has(ident)
withgetSuffix(ident)
andhasSuffix(ident)
the typechecker is now ~30% and uses ~50% less memory.