diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-26 16:43:30 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-08-26 17:57:09 +0200 |
commit | a438d3e4cb39ea7c12eba2ebc3a2399a680549f6 (patch) | |
tree | c544f839c61f046e4dba76679a9902fb42d3a570 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 36648547105bc8ac53dd63a03821a27243af13cd (diff) | |
download | dotty-a438d3e4cb39ea7c12eba2ebc3a2399a680549f6.tar.gz dotty-a438d3e4cb39ea7c12eba2ebc3a2399a680549f6.tar.bz2 dotty-a438d3e4cb39ea7c12eba2ebc3a2399a680549f6.zip |
Handle case where expected type of a SeqLiteral has an undetermined element type.
Test case is isApplicableSafe -Ycheck:first.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index f0086b0ab..fdcfe347b 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -895,7 +895,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } def typedSeqLiteral(tree: untpd.SeqLiteral, pt: Type)(implicit ctx: Context): SeqLiteral = track("typedSeqLiteral") { - val proto1 = pt.elemType orElse WildcardType + val proto1 = pt.elemType match { + case NoType => WildcardType + case bounds: TypeBounds => WildcardType(bounds) + case elemtp => elemtp + } val elems1 = tree.elems mapconserve (typed(_, proto1)) val proto2 = // the computed type of the `elemtpt` field if (!tree.elemtpt.isEmpty) WildcardType |