Skip to content

Commit d522ed9

Browse files
committed
Improved treatment of mixed programs
1 parent c8ad585 commit d522ed9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

accepted/future-releases/variance/feature-specification.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ available, but it is simply not using them.*
362362

363363
When a legacy library _L_ imports a library _L2_ with sound variance, the
364364
declarations imported from _L2_ are _legacy erased_. This means that all
365-
variance modifiers in type parameter declarations are removed.
365+
variance modifiers in type parameter declarations are ignored.
366366

367-
*[TODO: This is a source of unsoundness; we probably cannot require that
368-
every type argument passed to a contravariant type parameter in legacy code
369-
must be a top type. Can we generate all the required dynamic checks to
370-
maintain soundness?]*
367+
In a mixed program (where both legacy libraries and libraries with sound
368+
variance exist), a dynamic type check is performed on the actual arguments
369+
for each instance method parameter whose declared type contains a
370+
contravariant type variable.

0 commit comments

Comments
 (0)