Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message of generics with default value is not clear #146

Open
jitsedesmet opened this issue Oct 3, 2024 · 1 comment
Open

Error message of generics with default value is not clear #146

jitsedesmet opened this issue Oct 3, 2024 · 1 comment
Labels

Comments

@jitsedesmet
Copy link

Issue type:

  • 🐛 Bug

Description:

I had an issue where I had a class that was not generic, but should have a generic type with default value.
This case, where it apparently needed to have this generic was hard too discover because the error message is not very clear.

For example, when I have a class like:

export abstract class ActorExpressionEvaluatorFactory extends

that should have a generic type like:

export abstract class ActorExpressionEvaluatorFactory<TS = undefined> extends

I would get the exception:

error: Detected fatal error. Generated 'componentsjs-error-state.json' with more information.
      TypeError: Cannot read properties of undefined (reading 'term')
          at ParameterPropertyHandlerRange.hasType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:418:19)
          at typeTypeValidator (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:435:26)
          at GenericsContext.mergeRanges (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/GenericsContext.js:123:14)
          at ParameterPropertyHandlerRange.hasType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:469:60)
          at ParameterPropertyHandlerRange.hasType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:488:42)
          at ParameterPropertyHandlerRange.hasType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:488:42)
          at ParameterPropertyHandlerRange.hasValueType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:86:47)
          at ParameterPropertyHandlerRange.hasValueType (/home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:291:38)
          at /home/jitsedesmet/Documents/werken/ugent/comunica/node_modules/componentsjs/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js:104:18
          at Array.map (<anonymous>)

(Sorry if this description isn't very clear)


Environment:

Crash log:

@rubensworks
Copy link
Member

For reference, this issue may have been introduced in 5edd294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants