CLI: improve diagnostic message format
- render the whole line where the error/warning points to, if any, and another line with '^', like other compilers do - lowercase diagnostic severity - decapitalize the message if it doesn't start with a proper name
This commit is contained in:
+3
-1
@@ -1,5 +1,7 @@
|
||||
>>> fun foo() = 765
|
||||
>>> foo(1)
|
||||
ERROR: /line2.kts: (1, 5) Too many arguments for internal final fun foo(): kotlin.Int defined in <script>
|
||||
/line2.kts:1:5: error: too many arguments for internal final fun foo(): kotlin.Int defined in <script>
|
||||
foo(1)
|
||||
^
|
||||
>>> foo()
|
||||
765
|
||||
|
||||
+3
-1
@@ -2,4 +2,6 @@
|
||||
... object Bar {
|
||||
... }
|
||||
... }
|
||||
ERROR: /line4.kts: (2, 1) Named object 'Bar' is a singleton and cannot be local. Try to use anonymous object instead
|
||||
/line4.kts:2:1: error: named object 'Bar' is a singleton and cannot be local. Try to use anonymous object instead
|
||||
object Bar {
|
||||
^
|
||||
|
||||
+6
-2
@@ -1,6 +1,10 @@
|
||||
>>> )(
|
||||
ERROR: /line1.kts: (1, 1) Expecting an element
|
||||
ERROR: /line1.kts: (1, 3) Expecting an expression
|
||||
/line1.kts:1:1: error: expecting an element
|
||||
)(
|
||||
^
|
||||
/line1.kts:1:3: error: expecting an expression
|
||||
)(
|
||||
^
|
||||
>>> fun foo() = 98
|
||||
>>> foo()
|
||||
98
|
||||
|
||||
Reference in New Issue
Block a user