Closed pixelzoom closed 1 year ago
Do I need to apply a patch to see this assertion error?
I believe all that is needed here is making sure the core type is providing the right phetioType too:
Index: js/OopsDialog.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/OopsDialog.ts b/js/OopsDialog.ts
--- a/js/OopsDialog.ts (revision 3de8066bd9f1563ac64bc1fc5fefdd16dd31f834)
+++ b/js/OopsDialog.ts (date 1666379855031)
@@ -14,6 +14,7 @@
import { HBox, Image, Node, RichText, RichTextOptions } from '../../scenery/js/imports.js';
import Dialog, { DialogOptions } from '../../sun/js/Dialog.js';
import Tandem from '../../tandem/js/Tandem.js';
+import IOType from '../../tandem/js/types/IOType.js';
import phetGirlWaggingFinger_png from '../images/phetGirlWaggingFinger_png.js';
import PhetFont from './PhetFont.js';
import sceneryPhet from './sceneryPhet.js';
@@ -48,7 +49,8 @@
bottomMargin: 20,
// phet-io
- tandem: Tandem.OPTIONAL
+ tandem: Tandem.OPTIONAL,
+ phetioType: OopsDialog.OopsDialogIO
}, providedOptions );
const text = new RichText( messageString, optionize<RichTextOptions, EmptySelfOptions, RichTextOptions>()( {
@@ -80,7 +82,10 @@
}
//TODO https://github.com/phetsims/equality-explorer/issues/195 should OopsDialogIO extend DialogIO?
- public static readonly OopsDialogIO = Dialog.DialogIO;
+ public static readonly OopsDialogIO = new IOType( 'OopsDialogIO', {
+ valueType: OopsDialog,
+ supertype: Dialog.DialogIO
+ } );
}
sceneryPhet.register( 'OopsDialog', OopsDialog );
\ No newline at end of file
Ah yes, thanks -- the old "missing phetoioType" problem. This is something that I unfortunately do all the time, in many different places. And the error messages are almost always incomprehensible and downstream. Usually it only wastes my time. Sorry to have dragged 2 more devs in this time.
OopsDialogIO has been redefined in the above commit. Closing.
To instrument equality-explorer for #192, I'm using a PhetioCapsule to manage scenery-phet.OopsDialog.
Here's the relevant code in EqualityExplorerSceneNode:
Here's the current definition of
OopsDialogIO
in OopsDialog.ts:But this definition of OopsDialog doesn't seem quite right to me. OopsDialog is a subclass of Dialog, so OopsDialogIO should be a subclass of DialogIO. So I had originally defined OopsDialogIO like this:
That fails in Studio with:
To reproduce:
What am I doing wrong?