GULPF / nimquery

Nim library for querying HTML using CSS-selectors (like JavaScripts document.querySelector)
MIT License
134 stars 8 forks source link

Object case transition no longer allowed #4

Closed zedeus closed 5 years ago

zedeus commented 5 years ago

Using nimquery at runtime I get this error: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period

When building these warnings happen:

nimquery.nim(183, 17) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
nimquery.nim(176, 17) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
nimquery.nim(180, 17) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
nimquery.nim(172, 17) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
nimquery.nim(188, 17) Warning: Potential object case transition, instantiate new object instead [CaseTransition]

They're the object init procs, where you do result.kind =. I tried replacing that with Demand(kind: ..., but that gave this error: nimquery.nim(175, 11) Error: you must provide a compile-time value for the discriminator 'kind' in order to prove that it's safe to initialize 'element'.

GULPF commented 5 years ago

Fixed by #5