This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
invalid override error has wrong line number (class instead of method) #338
Closed
Description
I'm looking at SDK errors (#103) and noticed this:
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.& ((num) → num) is not a subtype of int.& ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.<< ((num) → num) is not a subtype of int.<< ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.>> ((num) → num) is not a subtype of int.>> ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.^ ((num) → num) is not a subtype of int.^ ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.abs (() → num) is not a subtype of int.abs (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.sign (() → num) is not a subtype of int.sign (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.unary- (() → num) is not a subtype of int.unary- (() → int). (dart:_interceptors/js_number.dart, line 349, col 13)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of JSNumber.| ((num) → num) is not a subtype of int.| ((int) → int). (dart:_interceptors/js_number.dart, line 349, col 13)
every error says "line 349, col 13" ... well, that happens to be this line:
class JSInt extends JSNumber implements int, double {
Activity
jmesserly commentedon Sep 18, 2015
oh, I think it's complaining because we
implement int
... hmmm, not sure if it's possible, but ideally we'd have three source locations: the base method (num.&), the incompatible override method (int.&) and the "extends JSNumber implements int" line. anyway ... I guess this is more of a feature request than a bug.jmesserly commentedon Oct 2, 2015
for now, we probably have other things more important. Once we get these into analysis_server it'll be a lot easier to work through strong mode errors/warnigns.