Skip to content

Select symbols also need to be modified in TreeTypeMap\TreeMap #143

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

Closed
DarkDimius opened this issue Jul 18, 2014 · 2 comments
Closed

Select symbols also need to be modified in TreeTypeMap\TreeMap #143

DarkDimius opened this issue Jul 18, 2014 · 2 comments

Comments

@DarkDimius
Copy link
Contributor

Such code will break extensionMethods(and similar breaks tailcalls).

package dotty.tools.dotc
package transform

import dotty.tools.dotc.core.Denotations._
import dotty.tools.dotc.core.Symbols._
import dotty.tools.dotc.core.Contexts._

class TC5(val ctx: Context) extends AnyVal {
  def candidates(mbr: SingleDenotation): Boolean = {
    implicit val c: Context = ctx
    mbr.symbol.exists
  }
}

After creating a fullyParameterizedDef, Select(mbr, 'symbol') has invalid symbol and thus NoType. Ycheck will die trying to find implicit conversion.

DarkDimius added a commit to DarkDimius/dotty that referenced this issue Jul 18, 2014
If some node in tree is transformed changing the type,
the outer node could potentially also change type.

This patch implements a TypedTreeMap that propagates those
changes until types converge. Propagation is done for tree nodes
that are able to compute their type based on their children:
Pair, Block, If, Match, CaseDef, Try, SeqLiteral, Annotated

Note: patch doesn't cover Select's, see scala#143 for the issue
with Select.
@retronym
Copy link
Member

While the tree/type maps should probably handle this, value classes should not be allowed to have val members.

@DarkDimius
Copy link
Contributor Author

@retronym thanks, I've restructured test so that it is correct from that perspective and can be compiled by scalac

odersky added a commit to dotty-staging/dotty that referenced this issue Jul 19, 2014
odersky added a commit that referenced this issue Jul 19, 2014
olhotak pushed a commit to olhotak/dotty that referenced this issue Oct 10, 2014
The problem was that TermRefWithSignatures did not take shadowed names into account
when reconstituting themselves under a new prefix.
olhotak pushed a commit to olhotak/dotty that referenced this issue Oct 10, 2014
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this issue Mar 19, 2025
Backport "Do not bring forward symbols created in transform and backend phases" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants