Skip to content

Compiler problem with incorrect default parameters in the VO dialect #2014

Description

@cpyrgas

In the following sample (VO dialect), the default parameter values have wrong types, but the compiler does not throw errors on that. When actually using those default values by calling the method, then the compiler throws and ICE.

In the Core dialect, it works properly, compiler reports:

error XS1750: A value of type 'logic' cannot be used as a default parameter because there are no standard conversions to type 'string'
error XS1750: A value of type 'string' cannot be used as a default parameter because there are no standard conversions to type 'logic'

// VO dialect
CLASS TestClass
	CONSTRUCTOR( n AS INT, l := FALSE AS STRING) AS VOID // no compiler error
	METHOD Test( n := "asd" AS LOGIC) AS VOID // no compiler error
END CLASS

FUNCTION Start() AS VOID
	LOCAL o AS TestClass
	o := TestClass{1} // ICE
	o:Test() // ICE

Activity

  1. added theissue type on Jul 25, 2026
  2. RobertvanderHulst commented on Aug 1, 2026

    @RobertvanderHulst
    Member

    It works in the core dialect because we're not storing the default in a special attribute, but we're passing the defaults to Roslyn.
    In the other dialects we're storing these values in an attribute for various reasons:

    • we can have defaults in the middle of the parameter list. C# does not allow that
    • we can have defaults that are not really a constant, such as symbols
    • that is what Vulcan did
  3. added a commit that references this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions