DSL's: any way to provide meaningful error messages?

31 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Kostas kougios

ungelesen,
06.10.2012, 18:13:1106.10.12
an scala...@googlegroups.com
I've made a DSL. When the code using the DSL is correct, everything reads fine. But when there is a compilation error, I get error msg's like

overloaded method value === with alternatives:   (v: com.googlecode.mapperdao.ColumnInfo[_, String])com.googlecode.mapperdao.Operation[com.googlecode.mapperdao.SimpleColumn] <and>   (v: String)com.googlecode.mapperdao.Operation[String]  cannot be applied to (com.googlecode.mapperdao.ColumnInfoManyToOne[QueryAutogeneratedSuite.this.Computer,Int,com.googlecode.mapperdao.SurrogateIntId,QueryAutogeneratedSuite.this.Company])

which is quite hard for the DSL user to understand. Is there a way of customising error messages? (googling didn't return any results)

Seyed H. HAERI (Hossein)

ungelesen,
06.10.2012, 18:47:5106.10.12
an scala-user
Scala Virtualised is your friend:


Whilst it can be very useful under many circumstances, Virtualised too comes with its limitations. I'm not sure whether it will solve your particular problem. But, it is certainly worth taking a look. :)

Enjoy!
--Hossein
--
--------------------------------------------------------------------------------------------------------------

Seyed H. HAERI (Hossein)

Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany

ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------

Naftoli Gugenheim

ungelesen,
11.10.2012, 23:19:0511.10.12
an Kostas kougios, scala...@googlegroups.com
If the error is that an implicit is not found (and perhaps you can refactor so that is the case), there's the @implicitNotFound annotation, which gives an alternative error message (it can even contain placeholders for the actual types involved).
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten