You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one wants to create a simple generic domain to represent an option type, one could use this (simplified) example:
domain Option[T] {
function none_val(): Option[T]
function some_of(x: T): Option[T]
axiom {
(forall x: T :: { some_of(x) } some_of(x) != none_val())
}
}
This works perfectly fine in VS Code, however, when one want to implement this in Silver, troubles can occur.
The generic function call some_of(x) can be modeled as
java.lang.Exception: Internal error in type system - unexpected non-ground type <T>
It is non-obvious from this error that the actual problem is the empty type variable map. Even in the generic case where you want to keep the generic type T a type variable map from T to T needs to be specified like this:
If one wants to create a simple generic domain to represent an option type, one could use this (simplified) example:
This works perfectly fine in VS Code, however, when one want to implement this in Silver, troubles can occur.
The generic function call
some_of(x)
can be modeled asThis code, however, throws an exception:
It is non-obvious from this error that the actual problem is the empty type variable map. Even in the generic case where you want to keep the generic type
T
a type variable map from T to T needs to be specified like this:Two possible solution might be to either have a default value for the type variable map or to make the error message clearer.
The text was updated successfully, but these errors were encountered: