Slightly better error reporting in build cache.
This commit is contained in:
@@ -93,6 +93,10 @@ class BuildCache {
|
|||||||
switch Context.getLocalType() {
|
switch Context.getLocalType() {
|
||||||
case TInst(_.toString() == name => true, [v]):
|
case TInst(_.toString() == name => true, [v]):
|
||||||
type = v;
|
type = v;
|
||||||
|
case TInst(_.toString() == name => true, _):
|
||||||
|
Context.fatalError('type parameter expected', pos);
|
||||||
|
case TInst(_.get() => { pos: pos }, _):
|
||||||
|
Context.fatalError('Expected $name', pos);
|
||||||
default:
|
default:
|
||||||
throw 'assert';
|
throw 'assert';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class Constructor {
|
|||||||
case Success(member): member.addMeta(':isVar');
|
case Success(member): member.addMeta(':isVar');
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
addStatement(macro @:pos(pos) (cast this).$name = if (true) $e else this.$name, options.prepend);
|
addStatement(macro @:pos(pos) (cast this).$name = if (true) $e else this.$name, options.prepend);//TODO: this seems to report type errors here rather than at the declaration position
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
addStatement(macro @:pos(pos) this.$name = $e, options.prepend);
|
addStatement(macro @:pos(pos) this.$name = $e, options.prepend);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Positions {
|
|||||||
return errorFunc(sanitize(pos), Std.string(error));
|
return errorFunc(sanitize(pos), Std.string(error));
|
||||||
|
|
||||||
static function contextError(pos:Position, error:String):Dynamic
|
static function contextError(pos:Position, error:String):Dynamic
|
||||||
return Context.error(error, pos);
|
return Context.fatalError(error, pos);
|
||||||
|
|
||||||
static function abortTypeBuild(pos:Position, error:String):Dynamic
|
static function abortTypeBuild(pos:Position, error:String):Dynamic
|
||||||
return throw new AbortBuild(error, pos);
|
return throw new AbortBuild(error, pos);
|
||||||
|
|||||||
Reference in New Issue
Block a user