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

SI-9200 Fix Java generic signatures for refined types #4374

Merged
merged 1 commit into from Mar 26, 2015

Conversation

Projects
None yet
4 participants
@retronym
Copy link
Member

retronym commented Mar 5, 2015

The erasure of a refined type T1 with T2 ... Tn is the
erasure of the intersection dominator of the elements.

In addition to erased method signatures, the compiler also emits
Java generic signatures, included information about generic types,
up to the point that it is possible to express in the language of
Java 5 generics.

Java generic signatures must be consistent with erasued signatures,
that is, the Java compiler must erase that generic signature to the
same erased signature. If this does not hold, linkage errors will
occur.

The compiler implements erasure in ErasureMap and java generic
signatures in Erasure#javaSig. Regrettably, these don't share
any implementation; e.g javaSig only takes the first parent of
a refinement type, rather than using intersectionDominator.

This commit fixes that discrepency.

Review by @lrytz

@scala-jenkins scala-jenkins added this to the 2.12.0-M1 milestone Mar 5, 2015

SI-9200 Fix Java generic signatures for refined types
The erasure of a refined type `T1 with T2 ... Tn` is the
erasure of the intersection dominator of the elements.

In addition to erased method signatures, the compiler also emits
Java generic signatures, included information about generic types,
up to the point that it is possible to express in the language of
Java 5 generics.

Java generic signatures must be consistent with erasued signatures,
that is, the Java compiler must erase that generic signature to the
same erased signature. If this does not hold, linkage errors will
occur.

The compiler implements erasure in `ErasureMap` and java generic
signatures in `Erasure#javaSig`. Regrettably, these don't share
any implementation; e.g `javaSig` only takes the first parent of
a refinement type, rather than using `intersectionDominator`.

This commit fixes that discrepency.

@retronym retronym force-pushed the retronym:ticket/9200 branch from 89f2cbb to 5471f01 Mar 5, 2015

@lrytz

This comment has been minimized.

Copy link
Member

lrytz commented Mar 26, 2015

LGTM

lrytz added a commit that referenced this pull request Mar 26, 2015

Merge pull request #4374 from retronym/ticket/9200
SI-9200 Fix Java generic signatures for refined types

@lrytz lrytz merged commit 4fe8cb6 into scala:2.12.x Mar 26, 2015

4 checks passed

integrate-ide [401] SUCCESS. Took 18 s.
Details
validate-main [638] SUCCESS. Took 64 min.
Details
validate-publish-core [636] SUCCESS. Took 11 min.
Details
validate-test [359] SUCCESS. Took 47 min.
Details

@adriaanm adriaanm added the 2.12 label Oct 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment