Skip to content

Fix #2782: Force less things when parsing generic signatures #2831

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
Jul 6, 2017
Merged
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
16 changes: 12 additions & 4 deletions compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ class ClassfileParser(
if (sig(index) == '<') {
accept('<')
var tp1: Type = tp
var formals = tp.typeParamSymbols
var formals: List[Symbol] =
if (skiptvs)
null
else
tp.typeParamSymbols
while (sig(index) != '>') {
sig(index) match {
case variance @ ('+' | '-' | '*') =>
Expand All @@ -311,11 +315,15 @@ class ClassfileParser(
else TypeBounds.lower(tp)
case '*' => TypeBounds.empty
}
tp1 = RefinedType(tp1, formals.head.name, bounds)
if (formals != null)
tp1 = RefinedType(tp1, formals.head.name, bounds)
case _ =>
tp1 = RefinedType(tp1, formals.head.name, TypeAlias(sig2type(tparams, skiptvs)))
val info = sig2type(tparams, skiptvs)
if (formals != null)
tp1 = RefinedType(tp1, formals.head.name, TypeAlias(info))
}
formals = formals.tail
if (formals != null)
formals = formals.tail
}
accept('>')
tp1
Expand Down