summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/list/compiler.lst2
-rw-r--r--config/list/lamplib.lst2
-rw-r--r--sources/scala/tools/scalai/Compiler.java21
-rw-r--r--sources/scala/tools/scalai/EvaluatorException.java6
-rw-r--r--sources/scala/tools/scalai/Interpreter.java4
-rw-r--r--sources/scalac/Global.java16
-rw-r--r--sources/scalac/Unit.java40
-rw-r--r--sources/scalac/ast/parser/Parser.java6
-rw-r--r--sources/scalac/ast/parser/Scanner.java27
-rw-r--r--sources/scalac/backend/jvm/GenJVM.java2
-rw-r--r--sources/scalac/backend/msil/GenMSIL.java7
-rw-r--r--sources/scalac/backend/msil/TypeCreator.java11
-rw-r--r--sources/scalac/symtab/Definitions.java1
-rw-r--r--sources/scalac/symtab/SourceCompleter.java4
-rw-r--r--sources/scalac/symtab/Symbol.java2
-rw-r--r--sources/scalac/symtab/Type.java1
-rw-r--r--sources/scalac/transformer/PatternMatcher.java2
-rw-r--r--sources/scalac/transformer/PatternNode.java3
-rw-r--r--sources/scalac/transformer/matching/PatternMatcher.java2
-rw-r--r--sources/scalac/transformer/matching/PatternNode.java3
-rw-r--r--sources/scalac/typechecker/Analyzer.java1
-rw-r--r--sources/scalac/typechecker/AnalyzerPhase.java1
-rw-r--r--sources/scalac/util/OptionParser.java6
-rw-r--r--sources/scalac/util/Reporter.java175
-rw-r--r--test/files/neg/S2.check4
-rw-r--r--test/files/neg/S4.check2
-rw-r--r--test/files/neg/S6.check2
-rw-r--r--test/files/neg/S7.check2
-rw-r--r--test/files/neg/abstract.check4
-rw-r--r--test/files/neg/altherr2.check2
-rw-r--r--test/files/neg/altherr3.check68
-rw-r--r--test/files/neg/bounds.check2
-rw-r--r--test/files/neg/constrparams.check2
-rw-r--r--test/files/neg/cyclic.check2
-rw-r--r--test/files/neg/imports.check18
-rw-r--r--test/files/neg/matthias2.check2
-rw-r--r--test/files/neg/michel2.check2
-rw-r--r--test/files/neg/protected.check2
-rw-r--r--test/files/neg/stable.check4
-rw-r--r--test/files/neg/vincent1.check2
-rw-r--r--test/neg/S2.check4
-rw-r--r--test/neg/S4.check2
-rw-r--r--test/neg/S6.check2
-rw-r--r--test/neg/S7.check2
-rw-r--r--test/neg/abstract.check4
-rw-r--r--test/neg/altherr2.check2
-rw-r--r--test/neg/altherr3.check68
-rw-r--r--test/neg/bounds.check2
-rw-r--r--test/neg/constrparams.check2
-rw-r--r--test/neg/cyclic.check2
-rw-r--r--test/neg/imports.check18
-rw-r--r--test/neg/matthias2.check2
-rw-r--r--test/neg/michel2.check2
-rw-r--r--test/neg/protected.check2
-rw-r--r--test/neg/stable.check4
-rw-r--r--test/neg/vincent1.check2
56 files changed, 333 insertions, 252 deletions
diff --git a/config/list/compiler.lst b/config/list/compiler.lst
index c1a356e554..21585d2a13 100644
--- a/config/list/compiler.lst
+++ b/config/list/compiler.lst
@@ -17,7 +17,6 @@ ast/parser/Parser.java
ast/parser/ParserPhase.java
ast/parser/Scanner.java
ast/parser/SourceRepresentation.java
-ast/parser/Sourcefile.java
ast/parser/TokenData.java
ast/parser/Tokens.java
@@ -118,7 +117,6 @@ util/Name.java
util/NameTransformer.java
util/Names.java
util/OptionParser.java
-util/Position.java
util/PrefixMatcher.java
util/Reporter.java
util/SourceRepresentation.java
diff --git a/config/list/lamplib.lst b/config/list/lamplib.lst
index a97d0c6636..e5297a2616 100644
--- a/config/list/lamplib.lst
+++ b/config/list/lamplib.lst
@@ -5,6 +5,8 @@
util/CodePrinter.java
util/Pair.java
+util/Position.java
+util/SourceFile.java
util/StackedMap.java
##############################################################################
diff --git a/sources/scala/tools/scalai/Compiler.java b/sources/scala/tools/scalai/Compiler.java
index 3269322f69..7e79fa692c 100644
--- a/sources/scala/tools/scalai/Compiler.java
+++ b/sources/scala/tools/scalai/Compiler.java
@@ -31,7 +31,6 @@ import scalac.symtab.TermSymbol;
import scalac.util.Debug;
import scalac.util.Name;
import scalac.util.Names;
-import scalac.util.Position;
import scala.runtime.RunTime;
@@ -97,12 +96,12 @@ public class Compiler {
Function.JavaMethod(getInvocationHandler_method),
new Code[] {
Code.Self},
- Position.NOPOS),
+ 0),
Function.JavaMethod(equals_method),
new Code[] {
Code.Load(
Code.Null, Variable.Argument(0))},
- Position.NOPOS),
+ 0),
0));
// !!! any_methods.put(_, equals_code);
any_methods.put(equals_method, equals_code);
@@ -122,7 +121,7 @@ public class Compiler {
definitions.HASHCODE,
Code.Invoke(
Code.Self, Function.HashCode, new Code[0],
- Position.NOPOS),
+ 0),
0));
any_methods.put(definitions.HASHCODE, hashCode_code);
any_methods.put(hashCode_method, hashCode_code);
@@ -146,7 +145,7 @@ public class Compiler {
definitions.TOSTRING,
Code.Invoke(
Code.Self, Function.ToString, new Code[0],
- Position.NOPOS),
+ 0),
0));
any_methods.put(definitions.TOSTRING, toString_code);
any_methods.put(toString_method, toString_code);
@@ -183,7 +182,7 @@ public class Compiler {
Code.Load(
Code.Null,
Variable.Argument(0)) },
- Position.NOPOS),
+ 0),
0));
any_methods.put(definitions.EQEQ, eqeq_code);
environment.insertFunction(definitions.EQEQ, Function.EqEq);
@@ -203,11 +202,11 @@ public class Compiler {
Code.Load(
Code.Null,
Variable.Argument(0)) },
- Position.NOPOS)},
- Position.NOPOS),
+ 0)},
+ 0),
Function.JavaMethod(bang_method),
new Code[0],
- Position.NOPOS),
+ 0),
0));
any_methods.put(definitions.BANGEQ, bangeq_code);
environment.insertFunction(definitions.BANGEQ, Function.BangEq);
@@ -330,8 +329,8 @@ public class Compiler {
// Private Methods -
private Symbol newGlobalVariable(Type type, Object value) {
- Symbol symbol = new TermSymbol(Position.NOPOS,
- Name.fromString(value.toString()), definitions.ROOT, 0);
+ Symbol symbol = new TermSymbol(
+ 0, Name.fromString(value.toString()), definitions.ROOT, 0);
symbol.setInfo(type);
environment.insertVariable(symbol, Variable.Global(value));
return symbol;
diff --git a/sources/scala/tools/scalai/EvaluatorException.java b/sources/scala/tools/scalai/EvaluatorException.java
index e6049deff5..22807adec5 100644
--- a/sources/scala/tools/scalai/EvaluatorException.java
+++ b/sources/scala/tools/scalai/EvaluatorException.java
@@ -11,10 +11,10 @@ package scalai;
import java.util.List;
import java.util.ArrayList;
+import ch.epfl.lamp.util.Position;
+
import scalac.Global;
-import scalac.ast.parser.Sourcefile;
import scalac.symtab.Symbol;
-import scalac.util.Position;
public class EvaluatorException extends RuntimeException {
@@ -54,7 +54,7 @@ public class EvaluatorException extends RuntimeException {
buffer.append('.');
buffer.append(method.nameString());
buffer.append('(');
- buffer.append(Sourcefile.files[Position.file(pos)]);
+ buffer.append(Position.file(pos));
buffer.append(':');
buffer.append(Position.line(pos));
buffer.append(")");
diff --git a/sources/scala/tools/scalai/Interpreter.java b/sources/scala/tools/scalai/Interpreter.java
index 7e5ec5446d..40aa1efa81 100644
--- a/sources/scala/tools/scalai/Interpreter.java
+++ b/sources/scala/tools/scalai/Interpreter.java
@@ -63,7 +63,7 @@ public class Interpreter {
public EvaluatorResult interpret(String input, boolean interactive) {
if (input.trim().length() == 0) return EvaluatorResult.Void;
- global.compile(input + ";", interactive);
+ global.compile("<console>", input + ";", interactive);
return interpret(interactive);
}
@@ -183,7 +183,7 @@ public class Interpreter {
// Private Methods - Signaling errors
private void error(String message) {
- global.reporter.error("error: " + message);
+ global.reporter.error(null, message);
}
//########################################################################
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index 0f0a144632..51ecb2a7a6 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -8,6 +8,8 @@
package scalac;
+import ch.epfl.lamp.util.SourceFile;
+
import java.io.*;
import java.util.*;
import scalac.util.*;
@@ -231,7 +233,7 @@ public class Global {
for (int i = 0; i < files.length; i++) {
String file = files[i];
try {
- units.add(new Unit(this, new Sourcefile(file), console));
+ units.add(new Unit(this, new SourceFile(file), console));
} catch (FileNotFoundException e) {
error("file " + file + " not found");
} catch (IOException e) {
@@ -244,9 +246,9 @@ public class Global {
/** the top-level compilation process
*/
- public void compile(String input, boolean console) {
+ public void compile(String filename, String input, boolean console) {
reporter.resetCounters();
- Sourcefile source = new Sourcefile(input.getBytes());
+ SourceFile source = new SourceFile(filename, input.getBytes());
units = new Unit[]{new Unit(this, source, console)};
compile();
}
@@ -283,8 +285,8 @@ public class Global {
imports.clear();
for (Iterator it = compiledNow.keySet().iterator(); it.hasNext();) {
Symbol sym = (Symbol) it.next();
- Sourcefile f = (Sourcefile) compiledNow.get(sym);
- sym.reset(new SourceCompleter(this, f.filename));
+ SourceFile f = (SourceFile) compiledNow.get(sym);
+ sym.reset(new SourceCompleter(this, f.name()));
}
}
compiledNow.clear();
@@ -472,13 +474,13 @@ public class Global {
/** issue a global error
*/
public void error(String message) {
- reporter.error("error: " + message);
+ reporter.error(null, message);
}
/** issue a global warning
*/
public void warning(String message) {
- reporter.warning("warning: " + message);
+ reporter.warning(null, message);
}
/** issue an operation note
diff --git a/sources/scalac/Unit.java b/sources/scalac/Unit.java
index 5f215b80ec..bc96a972c7 100644
--- a/sources/scalac/Unit.java
+++ b/sources/scalac/Unit.java
@@ -8,9 +8,11 @@
package scalac;
+import ch.epfl.lamp.util.SourceFile;
+import ch.epfl.lamp.util.Position;
+
import scalac.util.*;
import scalac.symtab.NameMangler;
-import scalac.ast.parser.Sourcefile;
import scalac.ast.Tree;
import scala.compiler.typechecker.*;
import java.io.*;
@@ -30,7 +32,7 @@ public class Unit {
/** the associated source code file
*/
- public final Sourcefile source;
+ public final SourceFile source;
/** does this unit come from the interpreter console
*/
@@ -60,11 +62,12 @@ public class Unit {
*/
public int notes;
- public Unit(Global global, Sourcefile source, boolean console) {
+ public Unit(Global global, SourceFile source, boolean console) {
this.global = global;
this.source = source;
this.console = console;
}
+
/*
public void print(String message) {
print(System.out, message);
@@ -77,34 +80,17 @@ public class Unit {
out.println("[[end " + message + "]]");
}
*/
- /** issue an error in this compilation unit
- */
- public void error(String message) {
- error(Position.NOPOS, message);
- }
/** issue an error in this compilation unit at a specific location
*/
public void error(int pos, String message) {
- boolean hidden = source.testAndSetLog(pos, message);
- if (!hidden) errors++;
- global.reporter.error(source.getMessage(pos, message), hidden);
- }
-
- /** issue a warning in this compilation unit
- */
- public void warning(String message) {
- warning(Position.NOPOS, message);
+ global.reporter.error(decode(pos), message);
}
/** issue a warning in this compilation unit at a specific location
*/
public void warning(int pos, String message) {
- if (global.reporter.nowarn) return;
- message = "warning: " + message;
- boolean hidden = source.testAndSetLog(pos, message);
- if (!hidden) warnings++;
- global.reporter.warning(source.getMessage(pos, message), hidden);
+ global.reporter.warning(decode(pos), message);
}
/** return a string representation
@@ -112,4 +98,14 @@ public class Unit {
public String toString() {
return source.toString();
}
+
+
+ private Position decode(int pos) {
+ Position position = new Position(pos);
+ if (position.file().id() == 0)
+ if (/* !!! source.id() > Position.FILE_MASK && */ position.line() != 0)
+ return source.getPosition(position.line(), position.column());
+ return position;
+ }
+
}
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java
index 8c478044fc..e483f09c04 100644
--- a/sources/scalac/ast/parser/Parser.java
+++ b/sources/scalac/ast/parser/Parser.java
@@ -8,6 +8,8 @@
package scalac.ast.parser;
+import ch.epfl.lamp.util.Position;
+
import java.util.*;
import scalac.*;
import scalac.util.*;
@@ -98,8 +100,8 @@ public class Parser implements Tokens {
int accept(int token) {
int pos = s.pos;
if (s.token != token) {
- int errpos = ((s.pos >>> Position.LINESHIFT) >
- (s.lastpos >>> Position.LINESHIFT)) ?
+ int errpos = ((s.pos >>> Position.COLUMN_BITS) >
+ (s.lastpos >>> Position.COLUMN_BITS)) ?
s.lastpos : s.pos;
syntaxError(errpos, s.token2string(token) + " expected but " +
s.token2string(s.token) + " found.", true);
diff --git a/sources/scalac/ast/parser/Scanner.java b/sources/scalac/ast/parser/Scanner.java
index c742cd929a..3555dcad5e 100644
--- a/sources/scalac/ast/parser/Scanner.java
+++ b/sources/scalac/ast/parser/Scanner.java
@@ -8,9 +8,11 @@
package scalac.ast.parser;
+import ch.epfl.lamp.util.Position;
+import ch.epfl.lamp.util.SourceFile;
+
import scalac.*;
import scalac.util.Name;
-import scalac.util.Position;
/** A scanner for the programming language Scala.
*
@@ -22,10 +24,10 @@ public class Scanner extends TokenData {
/** layout & character constants
*/
public int tabinc = 8;
- public final static byte LF = 0xA;
- protected final static byte FF = 0xC;
- protected final static byte CR = 0xD;
- protected final static byte SU = Sourcefile.SU;
+ protected final static byte LF = SourceFile.LF;
+ protected final static byte FF = SourceFile.FF;
+ protected final static byte CR = SourceFile.CR;
+ protected final static byte SU = SourceFile.SU;
/** the names of all tokens
*/
@@ -66,7 +68,7 @@ public class Scanner extends TokenData {
/** the current sourcefile
*/
- public Sourcefile currentSource;
+ public SourceFile currentSource;
/** a buffer for character and string literals
*/
@@ -82,7 +84,7 @@ public class Scanner extends TokenData {
*/
public Scanner(Unit unit) {
this.unit = unit;
- buf = (currentSource = unit.source).getBuffer();
+ buf = (currentSource = unit.source).bytes();
cline = 1;
bp = -1;
ccol = 0;
@@ -124,8 +126,8 @@ public class Scanner extends TokenData {
break;
default:
if (token == EOF ||
- ((pos >>> Position.LINESHIFT) >
- (prevpos >>> Position.LINESHIFT))) {
+ ((pos >>> Position.COLUMN_BITS) >
+ (prevpos >>> Position.COLUMN_BITS))) {
next.copyFrom(this);
this.token = SEMI;
this.pos = prevpos;
@@ -165,7 +167,7 @@ public class Scanner extends TokenData {
*/
public void fetchToken() {
if (token == EOF) return;
- lastpos = Position.encode(cline, ccol, currentSource.id);
+ lastpos = Position.encode(currentSource, cline, ccol);
int index = bp;
while(true) {
switch (ch) {
@@ -192,7 +194,7 @@ public class Scanner extends TokenData {
nextch();
break;
default:
- pos = Position.encode(cline, ccol, currentSource.id);
+ pos = Position.encode(currentSource, cline, ccol);
index = bp;
switch (ch) {
case 'A': case 'B': case 'C': case 'D': case 'E':
@@ -324,7 +326,6 @@ public class Scanner extends TokenData {
return;
case SU:
token = EOF;
- currentSource.lines = cline;
return;
default:
nextch();
@@ -573,7 +574,7 @@ public class Scanner extends TokenData {
putch(ch);
break;
default:
- syntaxError(Position.encode(cline, ccol, currentSource.id) - 1, "invalid escape character");
+ syntaxError(Position.encode(currentSource, cline, ccol) - 1, "invalid escape character");
putch(ch);
}
nextch();
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java
index 072f9564ae..11a4cd1316 100644
--- a/sources/scalac/backend/jvm/GenJVM.java
+++ b/sources/scalac/backend/jvm/GenJVM.java
@@ -13,6 +13,8 @@
package scalac.backend.jvm;
+import ch.epfl.lamp.util.Position;
+
import scalac.*;
import scalac.backend.*;
import scalac.util.*;
diff --git a/sources/scalac/backend/msil/GenMSIL.java b/sources/scalac/backend/msil/GenMSIL.java
index c580b06dd5..a12ad149da 100644
--- a/sources/scalac/backend/msil/GenMSIL.java
+++ b/sources/scalac/backend/msil/GenMSIL.java
@@ -16,7 +16,6 @@ import scalac.util.Debug;
import scalac.util.Name;
import scalac.util.Names;
-import scalac.util.Position;
import scalac.util.Debug;
import scalac.ast.Tree;
import Tree.*;
@@ -32,6 +31,7 @@ import scalac.backend.Primitives;
import ch.epfl.lamp.compiler.msil.*;
import ch.epfl.lamp.compiler.msil.emit.*;
+import ch.epfl.lamp.util.Position;
import Item.*;
@@ -1660,12 +1660,11 @@ public class GenMSIL /*implements Modifiers */ {
/**
*/
void log(String message) {
- System.err.println(message);
- //log(1, message);
+ global.reporter.printMessage(message);
}
void logErr(int pos, String message) {
- log(currUnit.source.getMessage(pos, message));
+ global.reporter.printMessage(new Position(pos), message);
}
void logErr(String message) {
diff --git a/sources/scalac/backend/msil/TypeCreator.java b/sources/scalac/backend/msil/TypeCreator.java
index e89bff38de..02e519d1e2 100644
--- a/sources/scalac/backend/msil/TypeCreator.java
+++ b/sources/scalac/backend/msil/TypeCreator.java
@@ -15,7 +15,6 @@ import scalac.ast.Tree;
import scalac.util.Debug;
import scalac.util.Name;
import scalac.util.Names;
-import scalac.util.Position;
import scalac.symtab.Kinds;
import scalac.symtab.TypeTags;
import scalac.symtab.Symbol;
@@ -27,6 +26,7 @@ import Tree.*;
import ch.epfl.lamp.compiler.msil.*;
import ch.epfl.lamp.compiler.msil.emit.*;
+import ch.epfl.lamp.util.Position;
import java.util.Map;
import java.util.ArrayList;
@@ -727,16 +727,11 @@ public final class TypeCreator
}
void log(String message) {
- System.err.println(message);
- //log(1, message);
+ global.reporter.printMessage(message);
}
void logErr(String message) {
- log(formatMessage(message));
- }
-
- String formatMessage(String message) {
- return unit.source.getMessage(pos, message);
+ global.reporter.printMessage(new Position(pos), message);
}
} // class TypeCreator
diff --git a/sources/scalac/symtab/Definitions.java b/sources/scalac/symtab/Definitions.java
index 61b078ba39..b729dc4b2a 100644
--- a/sources/scalac/symtab/Definitions.java
+++ b/sources/scalac/symtab/Definitions.java
@@ -8,6 +8,7 @@
package scalac.symtab;
+import ch.epfl.lamp.util.Position;
import scalac.*;
import scalac.util.*;
import scalac.symtab.classfile.*;
diff --git a/sources/scalac/symtab/SourceCompleter.java b/sources/scalac/symtab/SourceCompleter.java
index fefe00ab16..b315733922 100644
--- a/sources/scalac/symtab/SourceCompleter.java
+++ b/sources/scalac/symtab/SourceCompleter.java
@@ -8,6 +8,8 @@
package scalac.symtab;
+import ch.epfl.lamp.util.SourceFile;
+
import scalac.*;
import scalac.ast.parser.*;
import scalac.typechecker.Analyzer;
@@ -36,7 +38,7 @@ public class SourceCompleter extends Type.LazyType {
try {
String fname = filename;
long msec = System.currentTimeMillis();
- Unit unit = new Unit(global, new Sourcefile(filename), false);
+ Unit unit = new Unit(global, new SourceFile(filename), false);
filename = null;
global.PHASE.PARSER.apply(unit);
global.PHASE.ANALYZER.lateEnter(global, unit, c);
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 7ab12576da..23b062800f 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -10,6 +10,7 @@
package scalac.symtab;
+import ch.epfl.lamp.util.Position;
import scalac.ApplicationError;
import scalac.Global;
import scalac.PhaseDescriptor;
@@ -17,7 +18,6 @@ import scalac.util.ArrayApply;
import scalac.util.Name;
import scalac.util.Names;
import scalac.util.NameTransformer;
-import scalac.util.Position;
import scalac.util.Debug;
import scalac.symtab.classfile.*;
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 36e7431fdf..3855e86634 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -9,6 +9,7 @@
package scalac.symtab;
+import ch.epfl.lamp.util.Position;
import scalac.ApplicationError;
import scalac.util.*;
import scalac.Global;
diff --git a/sources/scalac/transformer/PatternMatcher.java b/sources/scalac/transformer/PatternMatcher.java
index 11dfb13d51..0e725ca302 100644
--- a/sources/scalac/transformer/PatternMatcher.java
+++ b/sources/scalac/transformer/PatternMatcher.java
@@ -8,6 +8,8 @@
package scalac.transformer;
+import ch.epfl.lamp.util.Position;
+
import scalac.*;
import scalac.ast.*;
import scalac.util.*;
diff --git a/sources/scalac/transformer/PatternNode.java b/sources/scalac/transformer/PatternNode.java
index 506fad2708..e4abdae047 100644
--- a/sources/scalac/transformer/PatternNode.java
+++ b/sources/scalac/transformer/PatternNode.java
@@ -8,6 +8,7 @@
package scalac.transformer;
+import ch.epfl.lamp.util.Position;
import scalac.*;
import scalac.ast.*;
import scalac.symtab.*;
@@ -15,7 +16,7 @@ import scalac.typechecker.*;
public class PatternNode {
- public int pos = scalac.util.Position.NOPOS;
+ public int pos = Position.NOPOS;
public Type type;
public PatternNode or;
public PatternNode and;
diff --git a/sources/scalac/transformer/matching/PatternMatcher.java b/sources/scalac/transformer/matching/PatternMatcher.java
index 11dfb13d51..0e725ca302 100644
--- a/sources/scalac/transformer/matching/PatternMatcher.java
+++ b/sources/scalac/transformer/matching/PatternMatcher.java
@@ -8,6 +8,8 @@
package scalac.transformer;
+import ch.epfl.lamp.util.Position;
+
import scalac.*;
import scalac.ast.*;
import scalac.util.*;
diff --git a/sources/scalac/transformer/matching/PatternNode.java b/sources/scalac/transformer/matching/PatternNode.java
index 506fad2708..e4abdae047 100644
--- a/sources/scalac/transformer/matching/PatternNode.java
+++ b/sources/scalac/transformer/matching/PatternNode.java
@@ -8,6 +8,7 @@
package scalac.transformer;
+import ch.epfl.lamp.util.Position;
import scalac.*;
import scalac.ast.*;
import scalac.symtab.*;
@@ -15,7 +16,7 @@ import scalac.typechecker.*;
public class PatternNode {
- public int pos = scalac.util.Position.NOPOS;
+ public int pos = Position.NOPOS;
public Type type;
public PatternNode or;
public PatternNode and;
diff --git a/sources/scalac/typechecker/Analyzer.java b/sources/scalac/typechecker/Analyzer.java
index b4b9d078d0..f4c79f4f94 100644
--- a/sources/scalac/typechecker/Analyzer.java
+++ b/sources/scalac/typechecker/Analyzer.java
@@ -15,6 +15,7 @@
package scalac.typechecker;
+import ch.epfl.lamp.util.Position;
import scalac.*;
import scalac.util.*;
import scalac.ast.*;
diff --git a/sources/scalac/typechecker/AnalyzerPhase.java b/sources/scalac/typechecker/AnalyzerPhase.java
index 1b36ccede7..6d61ba3d01 100644
--- a/sources/scalac/typechecker/AnalyzerPhase.java
+++ b/sources/scalac/typechecker/AnalyzerPhase.java
@@ -8,6 +8,7 @@
package scalac.typechecker;
+import ch.epfl.lamp.util.Position;
import scalac.*;
import scalac.util.*;
import scalac.ast.*;
diff --git a/sources/scalac/util/OptionParser.java b/sources/scalac/util/OptionParser.java
index 4796c96f93..c2c3af6e6f 100644
--- a/sources/scalac/util/OptionParser.java
+++ b/sources/scalac/util/OptionParser.java
@@ -8,6 +8,8 @@
package scalac.util;
+import ch.epfl.lamp.util.Position;
+
import java.text.Format;
import java.text.MessageFormat;
import java.util.List;
@@ -106,11 +108,11 @@ public class CommandParser {
}
public void error(String message) {
- reporter.error(product + ": " + message);
+ reporter.error(new Position(product), message);
}
public void warning(String message) {
- reporter.warning(product + ": " + message);
+ reporter.warning(new Position(product), message);
}
}
diff --git a/sources/scalac/util/Reporter.java b/sources/scalac/util/Reporter.java
index c4a50faf8e..ccf466ae7d 100644
--- a/sources/scalac/util/Reporter.java
+++ b/sources/scalac/util/Reporter.java
@@ -8,37 +8,59 @@
package scalac.util;
+import ch.epfl.lamp.util.Position;
+
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;
+import java.util.HashSet;
+
import scalac.ApplicationError;
public class Reporter {
//########################################################################
- // Private state
+ // Private Fields
+ /** The reader to ask for failures on demand */
private final BufferedReader reader;
+ /** The writer to print messages */
private final PrintWriter writer;
+ /** Log of error positions (used to avoid printing errors twice) */
+ private final HashSet positions;
+
/** Number of errors issued totally */
private int errors;
/** Number of warning issued totally */
private int warnings;
//########################################################################
- // Reporter constructors
+ // Public Fields
+ /** Whether warnings should be issued */
+ public boolean nowarn;
+ /** Whether information messages should be issued */
+ public boolean verbose;
+ /** Whether a prompt should be displayed after errors and warnings */
+ public boolean prompt;
+
+ //########################################################################
+ // Public Constructors
+
+ /** Initializes a new instance. */
public Reporter() {
this(
new BufferedReader(new InputStreamReader(System.in)),
new PrintWriter(System.err, true));
}
+ /** Initializes a new instance. */
public Reporter(BufferedReader reader, PrintWriter writer) {
this.reader = reader;
this.writer = writer;
+ this.positions = new HashSet();
this.prompt = false;
this.nowarn = false;
this.verbose = false;
@@ -46,111 +68,146 @@ public class Reporter {
}
//########################################################################
- // Reporter state
+ // Public Methods - Count
- /** Whether warnings should be issued */
- public boolean nowarn;
- /** Whether information messages should be issued */
- public boolean verbose;
- /** Whether a prompt should be displayed after errors and warnings */
- public boolean prompt;
-
- //########################################################################
- // Reporter interface - query
-
- /** Return the number of errors issued totally */
+ /** Returns the number of errors issued totally */
public int errors() {
return errors;
}
- /** Return the number of warnings issued totally */
+ /** Returns the number of warnings issued totally */
public int warnings() {
return warnings;
}
- /** Return the number of errors issued totally as a string */
+ /** Returns the number of errors issued totally as a string */
public String getErrorCountString() {
return getCountString(errors, "error");
}
- /** Return the number of warnings issued totally as a string */
+ /** Returns the number of warnings issued totally as a string */
public String getWarningCountString() {
return getCountString(warnings, "warning");
}
- public String getCountString(int count, String what) {
- switch (count) {
- case 0: return "no " + what + "s";
- case 1: return "one " + what;
- case 2: return "two " + what + "s";
- case 3: return "three " + what + "s";
- case 4: return "four " + what + "s";
- default: return count + " " + what + "s";
+ /** Returns a string meaning "n elements". */
+ public String getCountString(int n, String elements) {
+ switch (n) {
+ case 0: return "no " + elements + "s";
+ case 1: return "one " + elements;
+ case 2: return "two " + elements + "s";
+ case 3: return "three " + elements + "s";
+ case 4: return "four " + elements + "s";
+ default: return n + " " + elements + "s";
}
}
- //########################################################################
- // Reporter interface - report
-
- /** Reset all counters */
+ /** Resets all counters */
public void resetCounters() {
errors = 0;
warnings = 0;
}
- /** Issue a message */
+ //########################################################################
+ // Public Methods - Report
+
+ /** Issues a message */
public void report(String message) {
- writer.println(message);
+ printMessage(message);
}
- /** Issue a message */
+ /** Issues a message */
public void inform(String message) {
- if (verbose) report(message);
- }
-
- /** Issue an error */
- public void error(String message) {
- error(message, false);
+ if (verbose) printMessage(message);
}
- /** Issue an error if it is not hidden */
- public void error(String message, boolean hidden) {
- if (!hidden || prompt) report(message);
+ /** Issues an error */
+ public void error(Position position, String message) {
+ boolean hidden = testAndLog(position);
+ if (!hidden || prompt) printError(position, message);
if (!hidden) errors++;
if (prompt) failOnDemand();
}
- /** Issue a warning */
- public void warning(String message) {
- warning(message, false);
- }
-
- /** Issue a warning if it is not hidden */
- public void warning(String message, boolean hidden) {
+ /** Issues a warning */
+ public void warning(Position position, String message) {
+ boolean hidden = testAndLog(position);
if (nowarn) return;
- if (!hidden || prompt) report(message);
+ if (!hidden || prompt) printWarning(position, message);
if (!hidden) warnings++;
if (prompt) failOnDemand();
}
+ //########################################################################
+ // Public Methods - Print
+
+ /** Prints the message. */
+ public void printMessage(String message) {
+ writer.println(message);
+ }
+
+ /** Prints the message with the given position indication. */
+ public void printMessage(Position position, String message) {
+ if (position != null && position.file().id() != 0) {
+ message = " " + message;
+ if (position.line() != 0)
+ message = position.line() + ":" + message;
+ message = position.file().name() + ":" + message;
+ }
+ printMessage(message);
+ printSourceLine(position);
+ }
+
+ /** Prints the error message. */
+ public void printError(Position position, String message) {
+ if (position != null && position.file().id() == 0)
+ message = "error: " + message;
+ printMessage(position, message);
+ }
+
+ /** Prints the warning message. */
+ public void printWarning(Position position, String message) {
+ message = "warning: " + message;
+ printMessage(position, message);
+ }
+
+ /** Prints the number of errors and warnings if their are non-zero. */
public void printSummary() {
if (errors() > 0) report(getErrorCountString() + " found");
if (warnings() > 0) report(getWarningCountString() + " found");
}
+ /** Prints the source line of the given position. */
+ public void printSourceLine(Position position) {
+ if (position == null || position.file().id() == 0) return;
+ if (position.line() == 0) return;
+ printMessage(position.file().getLine(position.line()));
+ printColumnMarker(position);
+ }
+
+ /** Prints the column marker of the given position. */
+ public void printColumnMarker(Position position) {
+ int column = position == null ? 0 : position.column();
+ StringBuffer buffer = new StringBuffer(column);
+ for (int i = 1; i < column; i++) buffer.append(' ');
+ if (column > 0) buffer.append('^');
+ printMessage(buffer.toString());
+ }
+
//########################################################################
- // Reporter interface - fail
+ // Public Methods - Fail on demand
- /** Fail only if requested */
+ /** Fails only if requested. */
public void failOnDemand() {
failOnDemand("user abort");
}
- /** Fail only if requested */
+ /** Fails only if requested. */
public void failOnDemand(String message) {
try {
while (true) {
writer.print("r)esume, a)bort: ");
+ writer.flush();
String line = reader.readLine();
if (line == null) continue; else line = line.toLowerCase();
if ("abort".startsWith(line))
@@ -163,4 +220,18 @@ public class Reporter {
}
//########################################################################
+ // Private Methods
+
+ /** Logs a position and returns true if it was already logged. */
+ private boolean testAndLog(Position position) {
+ if (position == null) return false;
+ if (position.column() == 0) return false;
+ if (position.line() == 0) return false;
+ if (position.file().id() == 0) return false;
+ if (positions.contains(position)) return true;
+ positions.add(position);
+ return false;
+ }
+
+ //########################################################################
}
diff --git a/test/files/neg/S2.check b/test/files/neg/S2.check
index cb6bb9c991..0e55659ba4 100644
--- a/test/files/neg/S2.check
+++ b/test/files/neg/S2.check
@@ -1,7 +1,7 @@
-S2.scala:14: type z.type escapes its defining scope as part of z.Inner
+./neg/S2.scala:14: type z.type escapes its defining scope as part of z.Inner
def x = { val z = new S2(); new z.Inner(); }
^
-S2.scala:15: type z.type escapes its defining scope as part of z.Inner
+./neg/S2.scala:15: type z.type escapes its defining scope as part of z.Inner
def y = { val z = new S2(); new z.Inner(); }
^
two errors found
diff --git a/test/files/neg/S4.check b/test/files/neg/S4.check
index 7fd616488b..c4ccb91923 100644
--- a/test/files/neg/S4.check
+++ b/test/files/neg/S4.check
@@ -1,4 +1,4 @@
-S4.scala:5: stable identifier required, but a found.
+./neg/S4.scala:5: stable identifier required, but a found.
def foo(x: a.Inner) = x;
^
one error found
diff --git a/test/files/neg/S6.check b/test/files/neg/S6.check
index 6303e4c8e2..3b65e06d45 100644
--- a/test/files/neg/S6.check
+++ b/test/files/neg/S6.check
@@ -1,4 +1,4 @@
-S6.scala:11: illegal cyclic reference involving type S
+./neg/S6.scala:11: illegal cyclic reference involving type S
type S <: T;
^
one error found
diff --git a/test/files/neg/S7.check b/test/files/neg/S7.check
index 22769d0fe7..9e0e0e16b3 100644
--- a/test/files/neg/S7.check
+++ b/test/files/neg/S7.check
@@ -1,4 +1,4 @@
-S7.scala:6: illegal cyclic reference involving class S7.A
+./neg/S7.scala:6: illegal cyclic reference involving class S7.A
class C() extends a.A() {}
^
one error found
diff --git a/test/files/neg/abstract.check b/test/files/neg/abstract.check
index 11d01ce3d9..c64b93b505 100644
--- a/test/files/neg/abstract.check
+++ b/test/files/neg/abstract.check
@@ -1,7 +1,7 @@
-abstract.scala:5: malformed type: A.this.T#T
+./neg/abstract.scala:5: malformed type: A.this.T#T
def foo1 = bar().bar();
^
-abstract.scala:7: malformed type: A#T
+./neg/abstract.scala:7: malformed type: A#T
def foo3 = baz().bar();
^
two errors found
diff --git a/test/files/neg/altherr2.check b/test/files/neg/altherr2.check
index 53eeb2c84c..f546f8b1bb 100644
--- a/test/files/neg/altherr2.check
+++ b/test/files/neg/altherr2.check
@@ -1,4 +1,4 @@
-altherr2.scala:5: ';' expected but '[' found.
+./neg/altherr2.scala:5: ';' expected but '[' found.
foo()[Int];
^
one error found
diff --git a/test/files/neg/altherr3.check b/test/files/neg/altherr3.check
index 1ee3655290..789cc1b84e 100644
--- a/test/files/neg/altherr3.check
+++ b/test/files/neg/altherr3.check
@@ -1,169 +1,169 @@
-altherr3.scala:26: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:26: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0()); // error 1
^
-altherr3.scala:27: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:27: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0())); // error 2
^
-altherr3.scala:28: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:28: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0(foo0()))); // error 3
^
-altherr3.scala:29: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
+./neg/altherr3.scala:29: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0(foo0(foo0())))); // error 4
^
-altherr3.scala:32: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:32: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0())); // error 5
^
-altherr3.scala:33: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:33: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0(foo0()))); // error 6
^
-altherr3.scala:34: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:34: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 7
^
-altherr3.scala:38: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:38: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo0(foo0(foo0()))); // error 8
^
-altherr3.scala:39: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:39: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo0(foo0(foo0(foo0())))); // error 9
^
-altherr3.scala:49: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:49: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0())); // error 10
^
-altherr3.scala:50: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:50: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0(foo0()))); // error 11
^
-altherr3.scala:51: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:51: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0(foo0(foo0())))); // error 12
^
-altherr3.scala:55: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:55: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo0(foo0(foo0()))); // error 13
^
-altherr3.scala:56: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:56: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 14
^
-altherr3.scala:61: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:61: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Foo[Int]]](foo0(foo0(foo0(foo0())))); // error 15
^
-altherr3.scala:72: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:72: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Int](foo0(foo0(foo0()))); // error 16
^
-altherr3.scala:73: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:73: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Int](foo0(foo0(foo0(foo0())))); // error 17
^
-altherr3.scala:78: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:78: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 18
^
-altherr3.scala:95: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:95: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar3[Int](foo0(foo0(foo0(foo0())))); // error 20
^
-altherr3.scala:116: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:116: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1()); // error 21
^
-altherr3.scala:117: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:117: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1())); // error 22
^
-altherr3.scala:118: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:118: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1(foo1()))); // error 23
^
-altherr3.scala:119: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
+./neg/altherr3.scala:119: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1(foo1(foo1())))); // error 24
^
-altherr3.scala:122: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:122: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo1(foo1())); // error 25
^
-altherr3.scala:123: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:123: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo1(foo1(foo1()))); // error 26
^
-altherr3.scala:124: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:124: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo1(foo1(foo1())))); // error 27
^
-altherr3.scala:128: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:128: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo1(foo1(foo1()))); // error 28
^
-altherr3.scala:129: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:129: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo1(foo0(foo1(foo1())))); // error 29
^
-altherr3.scala:139: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:139: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1())); // error 30
^
-altherr3.scala:140: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:140: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1(foo1()))); // error 31
^
-altherr3.scala:141: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:141: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1(foo1(foo1())))); // error 32
^
-altherr3.scala:145: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:145: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo1(foo1(foo1()))); // error 33
^
-altherr3.scala:146: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:146: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo1(foo1(foo1(foo1())))); // error 34
^
-altherr3.scala:151: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:151: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Foo[Int]]](foo1(foo1(foo1(foo1())))); // error 35
diff --git a/test/files/neg/bounds.check b/test/files/neg/bounds.check
index 461086194f..c0eb0f6bed 100644
--- a/test/files/neg/bounds.check
+++ b/test/files/neg/bounds.check
@@ -1,4 +1,4 @@
-bounds.scala:11: type arguments [T] do not conform to constructor A's type parameter bounds [T >: I]
+./neg/bounds.scala:11: type arguments [T] do not conform to constructor A's type parameter bounds [T >: I]
class B[T >: J](init: T) extends A[T](init) {
^
one error found
diff --git a/test/files/neg/constrparams.check b/test/files/neg/constrparams.check
index 19eb56bf7f..4827895d06 100644
--- a/test/files/neg/constrparams.check
+++ b/test/files/neg/constrparams.check
@@ -1,4 +1,4 @@
-constrparams.scala:4: stable identifier required, but x found.
+./neg/constrparams.scala:4: stable identifier required, but x found.
private val z: x.t = null; //error
^
one error found
diff --git a/test/files/neg/cyclic.check b/test/files/neg/cyclic.check
index 2c23c8b26a..920380f591 100644
--- a/test/files/neg/cyclic.check
+++ b/test/files/neg/cyclic.check
@@ -1,4 +1,4 @@
-cyclic.scala:3: illegal cyclic reference involving type T
+./neg/cyclic.scala:3: illegal cyclic reference involving type T
type T = List[T];
^
one error found
diff --git a/test/files/neg/imports.check b/test/files/neg/imports.check
index 911d300c6f..0b8e32d5aa 100644
--- a/test/files/neg/imports.check
+++ b/test/files/neg/imports.check
@@ -1,28 +1,28 @@
-imports.scala:26: not found: value v_coi
+./neg/imports.scala:26: not found: value v_coi
def method: C_coi = v_coi;
^
-imports.scala:27: not found: value v_coi
+./neg/imports.scala:27: not found: value v_coi
val field: C_coi = v_coi;
^
-imports.scala:29: not found: value v_coi
+./neg/imports.scala:29: not found: value v_coi
check("C_coi", "v_coi ", v_coi);
^
-imports.scala:47: not found: value v_cio
+./neg/imports.scala:47: not found: value v_cio
def method: C_cio = v_cio;
^
-imports.scala:48: not found: value v_cio
+./neg/imports.scala:48: not found: value v_cio
val field: C_cio = v_cio;
^
-imports.scala:50: not found: value v_cio
+./neg/imports.scala:50: not found: value v_cio
check("C_cio", "v_cio ", v_cio);
^
-imports.scala:136: not found: value v_oci
+./neg/imports.scala:136: not found: value v_oci
def method: C_oci = v_oci;
^
-imports.scala:137: not found: value v_oci
+./neg/imports.scala:137: not found: value v_oci
val field: C_oci = v_oci;
^
-imports.scala:139: not found: value v_oci
+./neg/imports.scala:139: not found: value v_oci
check("C_oci", "v_oci ", v_oci);
^
9 errors found
diff --git a/test/files/neg/matthias2.check b/test/files/neg/matthias2.check
index 9bd56714cd..e3e2c0a85a 100644
--- a/test/files/neg/matthias2.check
+++ b/test/files/neg/matthias2.check
@@ -1,4 +1,4 @@
-matthias2.scala:7: illegal cyclic reference involving value y
+./neg/matthias2.scala:7: illegal cyclic reference involving value y
override val y: T;
^
one error found
diff --git a/test/files/neg/michel2.check b/test/files/neg/michel2.check
index 3317c40f61..9262facb0c 100644
--- a/test/files/neg/michel2.check
+++ b/test/files/neg/michel2.check
@@ -1,4 +1,4 @@
-michel2.scala:1: Java class may not be used as mixin
+./neg/michel2.scala:1: Java class may not be used as mixin
class A() extends java.lang.Object() with java.util.Random() { }
^
one error found
diff --git a/test/files/neg/protected.check b/test/files/neg/protected.check
index 23a5865dab..eed6f32d00 100644
--- a/test/files/neg/protected.check
+++ b/test/files/neg/protected.check
@@ -1,4 +1,4 @@
-protected.scala:11: error overriding method y in class A;
+./neg/protected.scala:11: error overriding method y in class A;
method y in class B has weaker access privileges; it should not be protected
protected def y(): int;
^
diff --git a/test/files/neg/stable.check b/test/files/neg/stable.check
index eaa64ef62a..51a86f6a7e 100644
--- a/test/files/neg/stable.check
+++ b/test/files/neg/stable.check
@@ -1,7 +1,7 @@
-stable.scala:10: stable identifier required, but test.y found.
+./neg/stable.scala:10: stable identifier required, but test.y found.
type b = y.T;
^
-stable.scala:11: stable identifier required, but test.z found.
+./neg/stable.scala:11: stable identifier required, but test.z found.
type c = z.T;
^
two errors found
diff --git a/test/files/neg/vincent1.check b/test/files/neg/vincent1.check
index b9243e7560..376e21dc1b 100644
--- a/test/files/neg/vincent1.check
+++ b/test/files/neg/vincent1.check
@@ -1,4 +1,4 @@
-vincent1.scala:7: type x.type escapes its defining scope as part of test.B { type T = x.T }
+./neg/vincent1.scala:7: type x.type escapes its defining scope as part of test.B { type T = x.T }
def functor(x: A): B { type T = x.T } =
^
one error found
diff --git a/test/neg/S2.check b/test/neg/S2.check
index cb6bb9c991..0e55659ba4 100644
--- a/test/neg/S2.check
+++ b/test/neg/S2.check
@@ -1,7 +1,7 @@
-S2.scala:14: type z.type escapes its defining scope as part of z.Inner
+./neg/S2.scala:14: type z.type escapes its defining scope as part of z.Inner
def x = { val z = new S2(); new z.Inner(); }
^
-S2.scala:15: type z.type escapes its defining scope as part of z.Inner
+./neg/S2.scala:15: type z.type escapes its defining scope as part of z.Inner
def y = { val z = new S2(); new z.Inner(); }
^
two errors found
diff --git a/test/neg/S4.check b/test/neg/S4.check
index 7fd616488b..c4ccb91923 100644
--- a/test/neg/S4.check
+++ b/test/neg/S4.check
@@ -1,4 +1,4 @@
-S4.scala:5: stable identifier required, but a found.
+./neg/S4.scala:5: stable identifier required, but a found.
def foo(x: a.Inner) = x;
^
one error found
diff --git a/test/neg/S6.check b/test/neg/S6.check
index 6303e4c8e2..3b65e06d45 100644
--- a/test/neg/S6.check
+++ b/test/neg/S6.check
@@ -1,4 +1,4 @@
-S6.scala:11: illegal cyclic reference involving type S
+./neg/S6.scala:11: illegal cyclic reference involving type S
type S <: T;
^
one error found
diff --git a/test/neg/S7.check b/test/neg/S7.check
index 22769d0fe7..9e0e0e16b3 100644
--- a/test/neg/S7.check
+++ b/test/neg/S7.check
@@ -1,4 +1,4 @@
-S7.scala:6: illegal cyclic reference involving class S7.A
+./neg/S7.scala:6: illegal cyclic reference involving class S7.A
class C() extends a.A() {}
^
one error found
diff --git a/test/neg/abstract.check b/test/neg/abstract.check
index 11d01ce3d9..c64b93b505 100644
--- a/test/neg/abstract.check
+++ b/test/neg/abstract.check
@@ -1,7 +1,7 @@
-abstract.scala:5: malformed type: A.this.T#T
+./neg/abstract.scala:5: malformed type: A.this.T#T
def foo1 = bar().bar();
^
-abstract.scala:7: malformed type: A#T
+./neg/abstract.scala:7: malformed type: A#T
def foo3 = baz().bar();
^
two errors found
diff --git a/test/neg/altherr2.check b/test/neg/altherr2.check
index 53eeb2c84c..f546f8b1bb 100644
--- a/test/neg/altherr2.check
+++ b/test/neg/altherr2.check
@@ -1,4 +1,4 @@
-altherr2.scala:5: ';' expected but '[' found.
+./neg/altherr2.scala:5: ';' expected but '[' found.
foo()[Int];
^
one error found
diff --git a/test/neg/altherr3.check b/test/neg/altherr3.check
index 1ee3655290..789cc1b84e 100644
--- a/test/neg/altherr3.check
+++ b/test/neg/altherr3.check
@@ -1,169 +1,169 @@
-altherr3.scala:26: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:26: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0()); // error 1
^
-altherr3.scala:27: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:27: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0())); // error 2
^
-altherr3.scala:28: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:28: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0(foo0()))); // error 3
^
-altherr3.scala:29: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
+./neg/altherr3.scala:29: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo0(foo0(foo0(foo0())))); // error 4
^
-altherr3.scala:32: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:32: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0())); // error 5
^
-altherr3.scala:33: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:33: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0(foo0()))); // error 6
^
-altherr3.scala:34: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:34: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 7
^
-altherr3.scala:38: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:38: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo0(foo0(foo0()))); // error 8
^
-altherr3.scala:39: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:39: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo0(foo0(foo0(foo0())))); // error 9
^
-altherr3.scala:49: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:49: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0())); // error 10
^
-altherr3.scala:50: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:50: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0(foo0()))); // error 11
^
-altherr3.scala:51: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:51: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo0(foo0(foo0(foo0())))); // error 12
^
-altherr3.scala:55: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:55: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo0(foo0(foo0()))); // error 13
^
-altherr3.scala:56: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:56: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 14
^
-altherr3.scala:61: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:61: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Foo[Int]]](foo0(foo0(foo0(foo0())))); // error 15
^
-altherr3.scala:72: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:72: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Int](foo0(foo0(foo0()))); // error 16
^
-altherr3.scala:73: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:73: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Int](foo0(foo0(foo0(foo0())))); // error 17
^
-altherr3.scala:78: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:78: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar2[Foo[Int]](foo0(foo0(foo0(foo0())))); // error 18
^
-altherr3.scala:95: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:95: no type parameters for method foo0 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar3[Int](foo0(foo0(foo0(foo0())))); // error 20
^
-altherr3.scala:116: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:116: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1()); // error 21
^
-altherr3.scala:117: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:117: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1())); // error 22
^
-altherr3.scala:118: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:118: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1(foo1()))); // error 23
^
-altherr3.scala:119: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
+./neg/altherr3.scala:119: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[bug.Foo[scala.All]]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Int](foo1(foo1(foo1(foo1())))); // error 24
^
-altherr3.scala:122: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:122: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo1(foo1())); // error 25
^
-altherr3.scala:123: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:123: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo1(foo1(foo1()))); // error 26
^
-altherr3.scala:124: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:124: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Int]](foo0(foo1(foo1(foo1())))); // error 27
^
-altherr3.scala:128: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:128: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo1(foo1(foo1()))); // error 28
^
-altherr3.scala:129: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:129: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar0[Foo[Foo[Int]]](foo1(foo0(foo1(foo1())))); // error 29
^
-altherr3.scala:139: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:139: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1())); // error 30
^
-altherr3.scala:140: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:140: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1(foo1()))); // error 31
^
-altherr3.scala:141: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
+./neg/altherr3.scala:141: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[bug.Foo[scala.All]])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Int](foo1(foo1(foo1(foo1())))); // error 32
^
-altherr3.scala:145: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:145: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo1(foo1(foo1()))); // error 33
^
-altherr3.scala:146: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
+./neg/altherr3.scala:146: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments (bug.Foo[scala.All])
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Int]](foo1(foo1(foo1(foo1())))); // error 34
^
-altherr3.scala:151: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
+./neg/altherr3.scala:151: no type parameters for method foo1 of type [a](a*)bug.Foo[a] exist so that it can be applied to arguments ()
--- because ---
result type bug.Foo[a] is incompatible with expected type scala.Int
bar1[Foo[Foo[Int]]](foo1(foo1(foo1(foo1())))); // error 35
diff --git a/test/neg/bounds.check b/test/neg/bounds.check
index 461086194f..c0eb0f6bed 100644
--- a/test/neg/bounds.check
+++ b/test/neg/bounds.check
@@ -1,4 +1,4 @@
-bounds.scala:11: type arguments [T] do not conform to constructor A's type parameter bounds [T >: I]
+./neg/bounds.scala:11: type arguments [T] do not conform to constructor A's type parameter bounds [T >: I]
class B[T >: J](init: T) extends A[T](init) {
^
one error found
diff --git a/test/neg/constrparams.check b/test/neg/constrparams.check
index 19eb56bf7f..4827895d06 100644
--- a/test/neg/constrparams.check
+++ b/test/neg/constrparams.check
@@ -1,4 +1,4 @@
-constrparams.scala:4: stable identifier required, but x found.
+./neg/constrparams.scala:4: stable identifier required, but x found.
private val z: x.t = null; //error
^
one error found
diff --git a/test/neg/cyclic.check b/test/neg/cyclic.check
index 2c23c8b26a..920380f591 100644
--- a/test/neg/cyclic.check
+++ b/test/neg/cyclic.check
@@ -1,4 +1,4 @@
-cyclic.scala:3: illegal cyclic reference involving type T
+./neg/cyclic.scala:3: illegal cyclic reference involving type T
type T = List[T];
^
one error found
diff --git a/test/neg/imports.check b/test/neg/imports.check
index 911d300c6f..0b8e32d5aa 100644
--- a/test/neg/imports.check
+++ b/test/neg/imports.check
@@ -1,28 +1,28 @@
-imports.scala:26: not found: value v_coi
+./neg/imports.scala:26: not found: value v_coi
def method: C_coi = v_coi;
^
-imports.scala:27: not found: value v_coi
+./neg/imports.scala:27: not found: value v_coi
val field: C_coi = v_coi;
^
-imports.scala:29: not found: value v_coi
+./neg/imports.scala:29: not found: value v_coi
check("C_coi", "v_coi ", v_coi);
^
-imports.scala:47: not found: value v_cio
+./neg/imports.scala:47: not found: value v_cio
def method: C_cio = v_cio;
^
-imports.scala:48: not found: value v_cio
+./neg/imports.scala:48: not found: value v_cio
val field: C_cio = v_cio;
^
-imports.scala:50: not found: value v_cio
+./neg/imports.scala:50: not found: value v_cio
check("C_cio", "v_cio ", v_cio);
^
-imports.scala:136: not found: value v_oci
+./neg/imports.scala:136: not found: value v_oci
def method: C_oci = v_oci;
^
-imports.scala:137: not found: value v_oci
+./neg/imports.scala:137: not found: value v_oci
val field: C_oci = v_oci;
^
-imports.scala:139: not found: value v_oci
+./neg/imports.scala:139: not found: value v_oci
check("C_oci", "v_oci ", v_oci);
^
9 errors found
diff --git a/test/neg/matthias2.check b/test/neg/matthias2.check
index 9bd56714cd..e3e2c0a85a 100644
--- a/test/neg/matthias2.check
+++ b/test/neg/matthias2.check
@@ -1,4 +1,4 @@
-matthias2.scala:7: illegal cyclic reference involving value y
+./neg/matthias2.scala:7: illegal cyclic reference involving value y
override val y: T;
^
one error found
diff --git a/test/neg/michel2.check b/test/neg/michel2.check
index 3317c40f61..9262facb0c 100644
--- a/test/neg/michel2.check
+++ b/test/neg/michel2.check
@@ -1,4 +1,4 @@
-michel2.scala:1: Java class may not be used as mixin
+./neg/michel2.scala:1: Java class may not be used as mixin
class A() extends java.lang.Object() with java.util.Random() { }
^
one error found
diff --git a/test/neg/protected.check b/test/neg/protected.check
index 23a5865dab..eed6f32d00 100644
--- a/test/neg/protected.check
+++ b/test/neg/protected.check
@@ -1,4 +1,4 @@
-protected.scala:11: error overriding method y in class A;
+./neg/protected.scala:11: error overriding method y in class A;
method y in class B has weaker access privileges; it should not be protected
protected def y(): int;
^
diff --git a/test/neg/stable.check b/test/neg/stable.check
index eaa64ef62a..51a86f6a7e 100644
--- a/test/neg/stable.check
+++ b/test/neg/stable.check
@@ -1,7 +1,7 @@
-stable.scala:10: stable identifier required, but test.y found.
+./neg/stable.scala:10: stable identifier required, but test.y found.
type b = y.T;
^
-stable.scala:11: stable identifier required, but test.z found.
+./neg/stable.scala:11: stable identifier required, but test.z found.
type c = z.T;
^
two errors found
diff --git a/test/neg/vincent1.check b/test/neg/vincent1.check
index b9243e7560..376e21dc1b 100644
--- a/test/neg/vincent1.check
+++ b/test/neg/vincent1.check
@@ -1,4 +1,4 @@
-vincent1.scala:7: type x.type escapes its defining scope as part of test.B { type T = x.T }
+./neg/vincent1.scala:7: type x.type escapes its defining scope as part of test.B { type T = x.T }
def functor(x: A): B { type T = x.T } =
^
one error found