Skip to content

[null safety] Unhelpful error message on argument mismatch for inline call #12455

@tobil4sk

Description

@tobil4sk
@:nullSafety
class Test {
  inline static function func(a:String, b:String) {
    return a + b;
  }
  
  static function main() {
    func(null, "");   
  }
}
[ERROR] Test.hx:8: characters 5-19

 8 |     func(null, "");   
   |     ^^^^^^^^^^^^^^
   | Null safety: Cannot assign nullable value here.

Compare with no inline:

[ERROR] Test.hx:8: characters 10-14

 8 |     func(null, "");   
   |          ^^^^
   | Null safety: Cannot pass nullable value to not-nullable argument "a" of function "func".

If it is a regular unification error, the message is the same for inline and non-inline, so hopefully the same could be achieved for null safety unification errors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions