Skip to content

Fix #3433: Fix determining typeParams for structural type members #3733

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

Merged
merged 1 commit into from
Feb 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/TypeApplications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class TypeApplications(val self: Type) extends AnyVal {
case self: TypeRef =>
val tsym = self.symbol
if (tsym.isClass) tsym.typeParams
else if (!tsym.exists) self.info.typeParams
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.How come we don't have the symbol for the refinement member here? That seems likely to be problematic in a lot of other cases, for example in the IDE how do we do "go to definition" if the tree has no symbol?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refinements of types that do not exist in the baseclass don't have a symbol. Which symbol could they have?

else if (!tsym.isCompleting) tsym.info.typeParams
else Nil
case self: AppliedType =>
Expand Down
4 changes: 4 additions & 0 deletions tests/pos/i3433.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object Test {
type Const[t] = { type L[x] = t }
type Bar[a] = Const[Int]#L[a]
}