Remove TCore type from Laurel HighType#1412
Conversation
|
@keyboardDrummer-bot please remove CoreType from the grammar as well. |
|
@keyboardDrummer-bot please rebase this on top of new target branch, reviewer-.. |
|
@keyboardDrummer I can't find a branch starting with |
|
Yes please rebase the commits from this PR, which is just 6c73bbd, onto reviewed-kbd-will-merge-to-main |
@keyboardDrummer-bot can you do this? |
Remove the TCore variant from HighType. All former TCore usages now produce UserDefined instead. The coreType grammar rule is preserved for backward compatibility but now creates UserDefined. In LaurelToCoreTranslator, the UserDefined fallback case now uses name.text (matching old TCore behavior) instead of hardcoded "Composite". Closes #1411
a51997b to
31bdc58
Compare
|
Done. I rebased the single commit There were merge conflicts in three files due to the |
When one branch of an if-then-else has type TVoid (e.g. pass statement or empty block), it should not conflict with the other branch's type. Previously this worked because TCore types (now removed) were gradual and consistent with everything including TVoid. With TCore removed, TVoid vs UserDefined types triggered a false incompatible-types error. Fix by short-circuiting the consistency check: if either branch is TVoid, the if-then-else result is TVoid (used for effect only).
Summary
Remove the
TCorevariant fromHighTypein Laurel. WhereverTCorewas created,UserDefinedis now used instead.Changes
TCore (s: String)variant from theHighTypeinductive type..TCore "unknown"with.UserDefined "unknown"incomputeExprType.TCorematch arms fromboxDestructorName,boxConstructorName, andboxConstructorDef— the existingUserDefinedbranches handle these cases.TCorecase fromcollectHighTypeNames—UserDefinedalready adds the type name.TCorecase fromcollectTypeRefs—UserDefinedalready returns[name.text].TCorefrom the fallback pattern in hole type inference.TCorecase; updatedUserDefinedfallback to return.tcons name.text [](preserving the oldTCoretranslation behavior) instead of.tcons "Composite" [].coreTypegrammar rule now creates.UserDefined name.TCoreserialization case (covered byUserDefined).Testing
Full
lake buildsucceeds with no errors.Closes #1411