-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix #19546 Missing compiler error for array in type definition (also … #20412
Conversation
As you're on the quest of fixing these issues, I will note that |
could you provide example? that's may not related , here are fix for type declaration and variable declaration, types your provide are in proc arguments. |
type A = object
a: openarray
b: sink
c: lent |
CI fails cause by https://github.com/SciNim/numericalnim/blob/614cb304d74ac32869ff74e0d013681ecf4ff5c8/src/numericalnim/integrate.nim#L420 suprised this syntax is used in real project. const gaussWeights: array[1..20, (seq, seq)] = [
(@[0.0],
@[2.0]), |
@beef331 told me |
Maybe a simpler solution is just to put Or, if we want to error just for object fields, change |
good idea, let's hear morevoice. |
Would it be possible, in case of a type definition, to add the field's name in the error message ? |
it's possible. let's see @Araq 's opinion. |
6dee7a4
to
737d146
Compare
Tested your code on some examples. type
myObject = object
tab: seq Now fails gracefully with a type
myObject[T] = object
tab: seq Why does this not fail ?! type
someGeneric[T] = object
field: seq
type
myObject = object
tab: someGeneric Fails with |
Here is a currently problematic error description: type
someGeneric[U, V] = object
a: seq[U]
b: seq
myObject = object
tab: someGeneric[int, string] got: ~/Documents/dev/typeGenericsIssue.nim(6, 5) Error: 'someGeneric' is not a concrete type |
I just re checked , generic can't check without instantiating, they will not turns to a node for check. I added a good case , the first generic type will not checked, but it can be used in second type. second one is plain object, it do check its definition. |
@Araq |
@Araq what else I can do for this? |
…apply to seq, set)
fix #19546
fix #13992
fix #19164
fix #6982
related: #15993