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

Add missing types to TASTy reflect #5483

Merged
merged 1 commit into from Nov 21, 2018

Conversation

Projects
None yet
2 participants
@nicolasstucki
Copy link
Contributor

nicolasstucki commented Nov 20, 2018

No description provided.

@liufengyun
Copy link
Contributor

liufengyun left a comment

It seems the new abstract types are not used, what is the motivation of having more refined types?

abstract class TypeTreeCoreModule {

/** Type tree representing an inferred type */
type Synthetic <: TypeTree

This comment has been minimized.

@liufengyun

liufengyun Nov 21, 2018

Contributor

Inferred instead of Synthetic?

This comment has been minimized.

@nicolasstucki

nicolasstucki Nov 21, 2018

Contributor

Good idea. I will propose it in another PR.

@nicolasstucki

This comment has been minimized.

Copy link
Contributor

nicolasstucki commented Nov 21, 2018

They will be used once we have constructors for them (#5438) and once we refine the pattern matching on abstract types (#5438). Meanwhile, they add some additional documentation.

@nicolasstucki nicolasstucki merged commit bcdc431 into lampepfl:master Nov 21, 2018

2 checks passed

CLA User signed CLA
Details
continuous-integration/drone/pr the build was successful
Details

@nicolasstucki nicolasstucki deleted the dotty-staging:add-missing-tasty-types branch Nov 21, 2018

type Return = tpd.Return
type Repeated = tpd.SeqLiteral
type Inlined = tpd.Inlined
type SelectOuter = tpd.Select

This comment has been minimized.

@liufengyun

liufengyun Nov 21, 2018

Contributor

What is SelectOuter? I think maybe there is no need for constructor for Inline

This comment has been minimized.

@nicolasstucki

nicolasstucki Nov 21, 2018

Contributor

Select outer is a special case of a Select where it keeps track of the inlined scoped to avoid ambiguities.

Inline is used to keep track of the source file where the tree came from to have a correct position. If the macros would just drop them, every position in the resulting tree would be incorrect.

@liufengyun

This comment has been minimized.

Copy link
Contributor

liufengyun commented Nov 21, 2018

When working on gestalt, I have a hypothesis that macro authors will never need to inspect type trees, because type trees are not semantic -- instead they can always inspect types. If this assumption is true, it can help simplify the reflection API.

@nicolasstucki

This comment has been minimized.

Copy link
Contributor

nicolasstucki commented Nov 21, 2018

That is assuming that we do not care about positions. For example we would not be able to emit an error such as:

fooMacro[List[Int]]
              ^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment