Skip to content

SI-8449 Fix spurious error with Java raw type over a Scala class#4117

Merged
adriaanm merged 1 commit intoscala:2.11.xfrom
retronym:ticket/8449
Nov 17, 2014
Merged

SI-8449 Fix spurious error with Java raw type over a Scala class#4117
adriaanm merged 1 commit intoscala:2.11.xfrom
retronym:ticket/8449

Conversation

@retronym
Copy link
Member

@retronym retronym commented Nov 9, 2014

When the Scala typechecker typechecks signatures in Java sources,
it must enable use of a type constructor without applied type
arguments (a raw type).

However, the check in adaptType::properTypeRequired was too
restricive: it only allows raw types given a) we are typechecking a
Java source file and b) the type constructor itself is Java defined.

The second check does not make sense; it is perfectly legal to define
a Java raw type for over a Scala defined type constructor. This commit
removes it.

The bug was noticed in the Scaladoc context, as it explores the
signatures of all Java sources so it can document them. But the
enclosed test demonstrates the underlying bug under normal
compilation.

Review by @adriaanm

When the Scala typechecker typechecks signatures in Java sources,
it must enable use of a type constructor without applied type
arguments (a raw type).

However, the check in `adaptType::properTypeRequired` was too
restricive: it only allows raw types given a) we are typechecking a
Java source file and b) the type constructor itself is Java defined.

The second check does not make sense; it is perfectly legal to define
a Java raw type for over a Scala defined type constructor. This commit
removes it.

The bug was noticed in the Scaladoc context, as it explores the
signatures of all Java sources so it can document them. But the
enclosed test demonstrates the underlying bug under normal
compilation.
@scala-jenkins scala-jenkins added this to the 2.11.5 milestone Nov 9, 2014
@lrytz lrytz assigned lrytz and adriaanm and unassigned lrytz Nov 10, 2014
@adriaanm
Copy link
Contributor

LGTM

adriaanm added a commit that referenced this pull request Nov 17, 2014
SI-8449 Fix spurious error with Java raw type over a Scala class
@adriaanm adriaanm merged commit b9c89cc into scala:2.11.x Nov 17, 2014
@som-snytt
Copy link
Contributor

I noticed the test files are not in pos.

lrytz added a commit to lrytz/scala that referenced this pull request May 17, 2016
@lrytz
Copy link
Member

lrytz commented May 17, 2016

thanks! #5171

lrytz added a commit to lrytz/scala that referenced this pull request May 17, 2016
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

Successfully merging this pull request may close these issues.

5 participants