scripting warning

Bug #867381 reported by Matthias Brantner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Markos Zaharioudakis

Bug Description

Would it be possible to raise a warning ("expected the function to return
xs:integer but it returns empty sequence") for the following function

declare function local:foo() as xs:integer
{
  1;
  2;
};

The problem is that when migrating from the old to the new scripting,
it easy to oversee problems where you would expect the function
to return something but it doesn't because of the last semi-colon.

A warning would help during the migration.

Tags: compiler
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Matthias, is this still relevant? In any case, I don't really understand what you are asking for: your example should raise an error anyway.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

I agree that the example should (and it actually does) raise a type error. This error is raised during runtime.

It would be nice if this error (or at least a warning) could be raised at compile time. It's obviously a problem in the code which might be easily missed in a huge project if there is not sufficient runtime testing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.