-
Notifications
You must be signed in to change notification settings - Fork 847
SyntaxTree: always keep parsed implicit constructors #10967
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
Conversation
|
It's ready. |
|
Thanks! |
|
|
||
| // Process a class declaration or F# type declaration | ||
| let rec walkTycon (TypeDefn(ComponentInfo(_, _, _, _, _, _, _, _), repr, membDefns, m)) = | ||
| let rec walkTycon (TypeDefn(ComponentInfo(_, _, _, _, _, _, _, _), repr, membDefns, _, m)) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect it to walk in it for object model types if it already does (via repr members), this behaviour hasn't changed. Do you mean it should walk in it for types that don't allow implicit constructors too? This PR only adds possibly thrown out constructors back, so it's possible to inspect them via syntax tree inside non-object model types too (via a separate field that is ignored by the type checker).
| | SynTypeDefnSigRepr.Exception(_) -> None | ||
|
|
||
| and walkTypeDefn (TypeDefn (info, repr, members, _)) = | ||
| and walkTypeDefn (TypeDefn (info, repr, members, _, _)) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there
| processExnDefnRepr baseName nested repr | ||
|
|
||
| and processTycon baseName (TypeDefn(ComponentInfo(_, _, _, lid, _, _, access, _), repr, membDefns, m)) = | ||
| and processTycon baseName (TypeDefn(ComponentInfo(_, _, _, lid, _, _, access, _), repr, membDefns, _, m)) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there?
| | SynModuleDecl.Open _ -> () | ||
|
|
||
| and walkSynTypeDefn(TypeDefn(componentInfo, representation, members, _)) container = | ||
| and walkSynTypeDefn(TypeDefn(componentInfo, representation, members, _, _)) container = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there
| None | ||
|
|
||
| and walkSynTypeDefn(TypeDefn(_componentInfo, representation, members, range)) = | ||
| and walkSynTypeDefn(TypeDefn(_componentInfo, representation, members, _, range)) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there
| | SynTypeDefnSigRepr.Exception _ -> () | ||
|
|
||
| and walkTypeDefn (TypeDefn (info, repr, members, _)) = | ||
| and walkTypeDefn (TypeDefn (info, repr, members, _, _)) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should walk the implicit ctor if it's there
Keeps parsed implicit constructors for types that are not allowed to have them in the syntax tree.