xp-forge / partial

Partials: Compile-time metaprogramming
0 stars 0 forks source link

Weird fatals... #14

Closed thekid closed 7 years ago

thekid commented 8 years ago

...if class loading fails. Fix was to migrate code to use new naming used since 0.6.0, see #12:

--- a/src/main/php/org/oneandone/appreciate/repository/Person.class.php
+++ b/src/main/php/org/oneandone/appreciate/repository/Person.class.php
@@ -1,9 +1,12 @@
 <?php namespace org\oneandone\appreciate\repository;

-use lang\partial\ValueObject;
+use lang\partial\Value;
+use lang\partial\Equals;

 class Person extends Identity {
-  use Person\including\ValueObject;
+  use Person\is\Value;
+  use Person\including\Equals;

Didn't break immediately but made unittests fail due to static initializers not being run. /cc @kiesel

thekid commented 7 years ago

An example:

$ cat Test.class.php
<?php

use lang\partial\Value;

class Test {
  use TYPO\is\Value;
}

$ xp mirror Test
Uncaught exception: Error (Call to a member function writeLine() on null)
thekid commented 7 years ago

Message now:

$ xp mirror Test
Uncaught exception: Exception lang.ClassDependencyException (
  Dependencies for class "Test" could not be loaded:
  Prefix "TYPO" does not refer to enclosing class
)