diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2016-01-28 18:49:47 +0100 |
---|---|---|
committer | Stefan Zeiger <szeiger@novocode.com> | 2016-01-28 18:49:47 +0100 |
commit | 0f088022aac31f8ce9f174490c45f481db2faae9 (patch) | |
tree | 8a063401cae28df22493aeda717b80d84cb48ad2 /src/intellij | |
parent | ea154faf467ae27c221ba0dcd7235e1e55673c51 (diff) | |
download | scala-0f088022aac31f8ce9f174490c45f481db2faae9.tar.gz scala-0f088022aac31f8ce9f174490c45f481db2faae9.tar.bz2 scala-0f088022aac31f8ce9f174490c45f481db2faae9.zip |
SI-9572 Check for illegal tuple sizes in the parser
This commit adds explicit checks with syntax errors for tuple literals
and types of more than 22 elements. An alternative approach to fixing
SI-9572 would be to revert to the old failure mode of Scala 2.10 where
references to arbitrary `scala.TupleXY` would be generated in the
parser, which then leads to “type/object not found” errors in the
typechecker. This fix here is more intrusive but arguably provides a
better user experience.
Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to
`Parsers` because they can now generate syntax errors. New methods
`makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking
on top of `makeTupleType` and `makeTupleTerm`. They are overridden with
no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
Diffstat (limited to 'src/intellij')
0 files changed, 0 insertions, 0 deletions