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
I suggest turning all build warnings into compiler errors. I have noticed that there are lots of potentially fatal errors lurking in Delite's codebase. There are many (>50) instances of code that relies upon not-present functionality. Specifically, pattern matching on something's type when that type information will not be present due to Java's runtime type erasure.
The standard ways to do this behavior w/in Scala use ClassTags. There's also TypeTags and Manifests, which are built for this exact thing. [1] However, there's an incompatibility w/ TypeTag for Scala 2.10 (iirc): only works on 2.11.
In my experience, I've been able to do a lot of runtime type checking by using a ClassTag, getting the actual type's runtime type (as a Class instance), then checking to see if that is the same type that we're looking for. This is a good resource [2].
For the flag, we'd have to go to project/Build.scala and add the following setting:
I suggest turning all build warnings into compiler errors. I have noticed that there are lots of potentially fatal errors lurking in Delite's codebase. There are many (>50) instances of code that relies upon not-present functionality. Specifically, pattern matching on something's type when that type information will not be present due to Java's runtime type erasure.
The standard ways to do this behavior w/in Scala use
ClassTag
s. There's alsoTypeTag
s andManifest
s, which are built for this exact thing. [1] However, there's an incompatibility w/TypeTag
for Scala 2.10 (iirc): only works on 2.11.In my experience, I've been able to do a lot of runtime type checking by using a
ClassTag
, getting the actual type's runtime type (as aClass
instance), then checking to see if that is the same type that we're looking for. This is a good resource [2].For the flag, we'd have to go to
project/Build.scala
and add the following setting:[1] http://docs.scala-lang.org/overviews/reflection/typetags-manifests.html
[2] https://scalerablog.wordpress.com/2015/12/21/classtag-class-and-war-stories/
The text was updated successfully, but these errors were encountered: