Changes between Initial Version and Version 1 of Ticket #191


Ignore:
Timestamp:
Jan 6, 2025, 5:00:45 PM (9 months ago)
Author:
ajbeach
Comment:

Updated to be (hopefully) a bit clearer and mention another example intptr that is logically simpler but actually has more parts to solve it.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #191

    • Property Summary Resolve For Assertions/TraitsPass More Information to Resolver
  • Ticket #191 – Description

    initial v1  
    1 I would like to add an extra argument to the resolver's `findSingleExpression` or to add a similar function that has a similar role but makes sure the result time satisfies a given trait.
     1I would like to add an extra argument to the resolver's `findSingleExpression` or to add a similar function that has a similar role but makes sure the result time satisfies a given trait or matches a certain pattern.
    22
    3 As we take advantage of the trait system there are now language constructs that allow any type given that it satisfies some assertions (usually expressed as a built in trait). Although it can resolve these conditions in code there does not appear to be a way to do it from a keyword. If there is there is some code that should be updated.
     3Language constructs do not always interact with fixed types. But those are the main constraints we can pass into the resolver. So instead language constructs are converted into functions that are more expressive and then resolved. Sometimes that is enough, other times we have to then convert the resolved functions into something else.
    44
    5 I have run into this when creating `throw` and `throwResume` implementations and it has forced me to split up some passes into a pre- and a post-resolver component. I believe `suspend` also has some issue.
    6 
    7 So far this hasn't actually prevented anything from working. If you add the right pre-resolver pass that converts things to functions you can still get it to work. However I believe this would simplify implementing language syntax that connects to traits.
     5Some examples include `throw` (there is a unbound type that must match a trait) and `intptr` (an unknown type that must be some variety of pointer). These and other examples all work, but they can include as much as a library or prelude function, a pre-resolver pass to convert the node to that and a post-resolver pass to convert or erase the function.